diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index d9f55ae28682..1a95e2856af8 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #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);