From 9fd57b44e440ceea9c3cbb75ba7b037de1db67d4 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Thu, 17 Jan 2013 09:52:35 +0000 Subject: [PATCH] * Correct KINFO_PROC_SIZE for ARM EABI. * Update the syscall interface to pass in the syscall value in register r7. --- sys/arm/arm/trap.c | 8 +++++++- sys/arm/include/proc.h | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c index e737dc8108a2..bdc4ccc2e0c5 100644 --- a/sys/arm/arm/trap.c +++ b/sys/arm/arm/trap.c @@ -866,7 +866,11 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) register_t *ap; int error; +#ifdef __ARM_EABI__ + sa->code = td->td_frame->tf_r7; +#else sa->code = sa->insn & 0x000fffff; +#endif ap = &td->td_frame->tf_r0; if (sa->code == SYS_syscall) { sa->code = *ap++; @@ -905,16 +909,18 @@ syscall(struct thread *td, trapframe_t *frame) struct syscall_args sa; int error; +#ifndef __ARM_EABI__ sa.insn = *(uint32_t *)(frame->tf_pc - INSN_SIZE); switch (sa.insn & SWI_OS_MASK) { case 0: /* XXX: we need our own one. */ - sa.nap = 4; break; default: call_trapsignal(td, SIGILL, 0); userret(td, frame); return; } +#endif + sa.nap = 4; error = syscallenter(td, &sa); KASSERT(error != 0 || td->td_ar == NULL, diff --git a/sys/arm/include/proc.h b/sys/arm/include/proc.h index c1bce0019b8a..597a5adc511a 100644 --- a/sys/arm/include/proc.h +++ b/sys/arm/include/proc.h @@ -60,7 +60,11 @@ struct mdproc { void *md_sigtramp; }; +#ifdef __ARM_EABI__ +#define KINFO_PROC_SIZE 816 +#else #define KINFO_PROC_SIZE 792 +#endif #define MAXARGS 8 struct syscall_args { @@ -69,7 +73,9 @@ struct syscall_args { register_t args[MAXARGS]; int narg; u_int nap; +#ifndef __ARM_EABI__ u_int32_t insn; +#endif }; #endif /* !_MACHINE_PROC_H_ */