- Handle kdb switch panics outside of mi_switch() to remove some instructions
from the common path and make the code more clear. Whether this has any impact on performance may depend on optimization levels. Sponsored by: Nokia
This commit is contained in:
parent
73daf66f41
commit
8f93d79d05
@ -365,6 +365,15 @@ wakeup_one(ident)
|
||||
sleepq_release(ident);
|
||||
}
|
||||
|
||||
static void
|
||||
kdb_switch(void)
|
||||
{
|
||||
thread_unlock(curthread);
|
||||
kdb_backtrace();
|
||||
kdb_reenter();
|
||||
panic("%s: did not reenter debugger", __func__);
|
||||
}
|
||||
|
||||
/*
|
||||
* The machine independent parts of context switching.
|
||||
*/
|
||||
@ -394,12 +403,8 @@ mi_switch(int flags, struct thread *newtd)
|
||||
/*
|
||||
* Don't perform context switches from the debugger.
|
||||
*/
|
||||
if (kdb_active) {
|
||||
thread_unlock(td);
|
||||
kdb_backtrace();
|
||||
kdb_reenter();
|
||||
panic("%s: did not reenter debugger", __func__);
|
||||
}
|
||||
if (kdb_active)
|
||||
kdb_switch();
|
||||
if (flags & SW_VOL)
|
||||
td->td_ru.ru_nvcsw++;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user