From owner-svn-src-head@FreeBSD.ORG Thu Jul 15 01:47:48 2010 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 694A51065673; Thu, 15 Jul 2010 01:47:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EE968FC0C; Thu, 15 Jul 2010 01:47:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6F1lmbM042958; Thu, 15 Jul 2010 01:47:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6F1lmvX042954; Thu, 15 Jul 2010 01:47:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007150147.o6F1lmvX042954@svn.freebsd.org> From: Warner Losh Date: Thu, 15 Jul 2010 01:47:48 +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: r210096 - head/sys/mips/mips 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: Thu, 15 Jul 2010 01:47:48 -0000 Author: imp Date: Thu Jul 15 01:47:47 2010 New Revision: 210096 URL: http://svn.freebsd.org/changeset/base/210096 Log: Remove one layer of indirection. No need to call cpu_throw which then calls mips_cpu_call via an obfuscated assembler call. Instead, delete the current cpu_throw, and rename mips_cpu_throw to cpu_throw. This is nicer to the cache on each context switch (since fixed jumps can be prefected, while jumps through a register can't). Incidentally, it also saves about 5 or 6 instructions. Reviewed by: jmallet@ Modified: head/sys/mips/mips/db_trace.c head/sys/mips/mips/swtch.S head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Thu Jul 15 01:18:37 2010 (r210095) +++ head/sys/mips/mips/db_trace.c Thu Jul 15 01:47:47 2010 (r210096) @@ -168,9 +168,9 @@ loop: subr = (uintptr_t)MipsTLBInvalidException; else if (pcBetween(fork_trampoline, savectx)) subr = (uintptr_t)fork_trampoline; - else if (pcBetween(savectx, mips_cpu_throw)) + else if (pcBetween(savectx, cpu_throw)) subr = (uintptr_t)savectx; - else if (pcBetween(mips_cpu_throw, cpu_switch)) + else if (pcBetween(cpu_throw, cpu_switch)) subr = (uintptr_t)cpu_throw; else if (pcBetween(cpu_switch, MipsSwitchFPState)) subr = (uintptr_t)cpu_switch; Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Thu Jul 15 01:18:37 2010 (r210095) +++ head/sys/mips/mips/swtch.S Thu Jul 15 01:47:47 2010 (r210096) @@ -216,7 +216,7 @@ LEAF(savectx) move v0, zero END(savectx) -NON_LEAF(mips_cpu_throw, CALLFRAME_SIZ, ra) +NON_LEAF(cpu_throw, CALLFRAME_SIZ, ra) mfc0 t0, MIPS_COP_0_STATUS # t0 = saved status register nop nop @@ -227,7 +227,7 @@ NON_LEAF(mips_cpu_throw, CALLFRAME_SIZ, # thread's context, so jump # right to action nop # BDSLOT -END(mips_cpu_throw) +END(cpu_throw) /* * cpu_switch(struct thread *old, struct thread *new, struct mutex *mtx); Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Jul 15 01:18:37 2010 (r210095) +++ head/sys/mips/mips/vm_machdep.c Thu Jul 15 01:47:47 2010 (r210096) @@ -543,14 +543,6 @@ cpu_set_user_tls(struct thread *td, void return (0); } -void -cpu_throw(struct thread *old, struct thread *new) -{ - - func_2args_asmmacro(&mips_cpu_throw, old, new); - panic("mips_cpu_throw() returned"); -} - #ifdef DDB #include