From bf0acc273a119b831959adba75a1c1de8ade7c51 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 2 Jul 2004 19:09:50 +0000 Subject: - Change mi_switch() and sched_switch() to accept an optional thread to switch to. If a non-NULL thread pointer is passed in, then the CPU will switch to that thread directly rather than calling choosethread() to pick a thread to choose to. - Make sched_switch() aware of idle threads and know to do TD_SET_CAN_RUN() instead of sticking them on the run queue rather than requiring all callers of mi_switch() to know to do this if they can be called from an idlethread. - Move constants for arguments to mi_switch() and thread_single() out of the middle of the function prototypes and up above into their own section. --- sys/kern/subr_sleepqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/subr_sleepqueue.c') diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 79bbf2c06bc3..a7a07d5e6059 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -409,7 +409,7 @@ sleepq_switch(void *wchan) sched_sleep(td); TD_SET_SLEEPING(td); - mi_switch(SW_VOL); + mi_switch(SW_VOL, NULL); KASSERT(TD_IS_RUNNING(td), ("running but not TDS_RUNNING")); CTR3(KTR_PROC, "sleepq resume: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, (void *)td->td_proc->p_comm); @@ -449,7 +449,7 @@ sleepq_check_timeout(void) else if (callout_stop(&td->td_slpcallout) == 0) { td->td_flags |= TDF_TIMEOUT; TD_SET_SLEEPING(td); - mi_switch(SW_INVOL); + mi_switch(SW_INVOL, NULL); } return (0); } -- cgit v1.2.3