unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (NetBSD-2.0)
Page:
Section:
Apropos / Subsearch:
optional field

CPU_IDLE(9)              BSD Kernel Developer's Manual             CPU_IDLE(9)

NAME
     cpu_idle -- idle CPU while waiting for work

SYNOPSIS
     #include <&lt;sys/proc.h>&gt;

     void
     cpu_idle(void);

DESCRIPTION
     The cpu_idle() function is invoked to idle the current CPU while waiting
     for work to be done.  It is primarily called by the scheduler if no pro-
     cesses are available on the system run queue.  The cpu_idle() function is
     a machine-dependent implementations in order to permit low-level CPU con-
     trol.

     The cpu_idle() function must be called with the scheduler lock held and
     at the splsched(9) interrupt protection level.  It performs the following
     operations:

     o   Release the scheduler lock.

     o   Lower the current interrupt priority level to permit interrupts to be
         taken that will eventually cause processes to appear again on the
         system run queue.

     o   Try to zero some pages for the virtual memory system.

     o   Perform any CPU or system power control.

     o   Wait until a process appears on the system run queue.

     o   Acquire the scheduler lock.

     For CPUs which don't support an idle operation, the CPU must spin until a
     process appears on the system run queue.  Generally, this is done by
     checking if the sched_whichqs variable in the scheduler is not zero.  See
     setrunqueue(9) for further details.

SEE ALSO
     mi_switch(9), scheduler(9), setrunqueue(9), spl(9), uvm(9)

BSD                           September 21, 2002                           BSD