Date: Thu, 15 Jul 2010 01:47:48 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r210096 - head/sys/mips/mips Message-ID: <201007150147.o6F1lmvX042954@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <ddb/ddb.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007150147.o6F1lmvX042954>