summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2012-08-11 05:58:56 +0000
committerandrew <andrew@FreeBSD.org>2012-08-11 05:58:56 +0000
commite70ae9c439dfc7dae667e62f9ae2cffde3818e09 (patch)
tree930c9b8ad9a460f2d25b8dba0432e4e55196b553 /sys/arm
parent5d28872c59cb8c8d5bc8f89af73af575a53ba24a (diff)
downloadFreeBSD-src-e70ae9c439dfc7dae667e62f9ae2cffde3818e09.zip
FreeBSD-src-e70ae9c439dfc7dae667e62f9ae2cffde3818e09.tar.gz
Move the decoding of the swi instruction to the syscall function. With the
ARM EABI the syscall value will be moved to a register to ease adding thumb support. When this happens decoding of the instruction will no longer be required.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/trap.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c
index 0d915da..e737dc8 100644
--- a/sys/arm/arm/trap.c
+++ b/sys/arm/arm/trap.c
@@ -900,14 +900,13 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
#include "../../kern/subr_syscall.c"
static void
-syscall(struct thread *td, trapframe_t *frame, u_int32_t insn)
+syscall(struct thread *td, trapframe_t *frame)
{
struct syscall_args sa;
int error;
- td->td_frame = frame;
- sa.insn = insn;
- switch (insn & SWI_OS_MASK) {
+ 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;
@@ -927,7 +926,6 @@ void
swi_handler(trapframe_t *frame)
{
struct thread *td = curthread;
- uint32_t insn;
td->td_frame = frame;
@@ -941,7 +939,6 @@ swi_handler(trapframe_t *frame)
userret(td, frame);
return;
}
- insn = *(u_int32_t *)(frame->tf_pc - INSN_SIZE);
/*
* Enable interrupts if they were enabled before the exception.
* Since all syscalls *should* come from user mode it will always
@@ -954,6 +951,6 @@ swi_handler(trapframe_t *frame)
enable_interrupts(F32_bit);
}
- syscall(td, frame, insn);
+ syscall(td, frame);
}
OpenPOWER on IntegriCloud