Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2012 05:58:56 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239191 - head/sys/arm/arm
Message-ID:  <201208110558.q7B5wuAk022188@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sat Aug 11 05:58:56 2012
New Revision: 239191
URL: http://svn.freebsd.org/changeset/base/239191

Log:
  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.

Modified:
  head/sys/arm/arm/trap.c

Modified: head/sys/arm/arm/trap.c
==============================================================================
--- head/sys/arm/arm/trap.c	Sat Aug 11 05:45:19 2012	(r239190)
+++ head/sys/arm/arm/trap.c	Sat Aug 11 05:58:56 2012	(r239191)
@@ -900,14 +900,13 @@ cpu_fetch_syscall_args(struct thread *td
 #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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208110558.q7B5wuAk022188>