From owner-svn-src-head@FreeBSD.ORG Sat Aug 11 05:58:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6EEE106566B; Sat, 11 Aug 2012 05:58:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1C098FC08; Sat, 11 Aug 2012 05:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7B5wukl022190; Sat, 11 Aug 2012 05:58:56 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7B5wuAk022188; Sat, 11 Aug 2012 05:58:56 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201208110558.q7B5wuAk022188@svn.freebsd.org> From: Andrew Turner Date: Sat, 11 Aug 2012 05:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239191 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2012 05:58:56 -0000 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); }