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@
This commit is contained in:
Warner Losh 2010-07-15 01:47:47 +00:00
parent f42e89b842
commit b82b0cb2b1
3 changed files with 4 additions and 12 deletions

View File

@ -168,9 +168,9 @@ stacktrace_subr(register_t pc, register_t sp, register_t ra,
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;

View File

@ -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, ra)
# 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);

View File

@ -543,14 +543,6 @@ cpu_set_user_tls(struct thread *td, void *tls_base)
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>