1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Create an event (idle_event) which is invoked every time around the

idle loop.  Machine-dependant code can elect to eg. take power-saving
actions when this event is invoked.
This commit is contained in:
Mike Smith 2000-09-22 03:19:24 +00:00
parent 72b535ef45
commit bdf3d8b954
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66207

View File

@ -18,6 +18,7 @@
#include <sys/unistd.h>
#include <sys/kthread.h>
#include <sys/queue.h>
#include <sys/eventhandler.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#ifdef KTRACE
@ -44,6 +45,8 @@ SYSINIT(idle_setup, SI_SUB_SCHED_IDLE, SI_ORDER_FIRST, idle_setup, NULL)
static void idle_proc(void *dummy);
EVENTHANDLER_FAST_DEFINE(idle_event, idle_eventhandler_t);
/*
* setup per-cpu idle process contexts
*/
@ -88,9 +91,13 @@ idle_proc(void *dummy)
* This is a good place to put things to be done in
* the background, including sanity checks.
*/
if (count++ < 0)
CTR0(KTR_PROC, "idle_proc: timed out waiting"
" for a process");
/* call out to any cpu-becoming-idle events */
EVENTHANDLER_FAST_INVOKE(idle_event, count);
}
mtx_enter(&sched_lock, MTX_SPIN);