man.bsd.lv manual page server

Manual Page Search Parameters

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

cpu_idlemachine-dependent processor idling interface

#include <sys/cpu.h>

void
cpu_idle(void);

() is called by machine-independent code when the processor has nothing to do. It can be used to conserve the processor power, for example.

() returns immediately if () has been called for the processor after the last call of cpu_idle() or () on the processor. cpu_idle() returns as soon as possible when cpu_need_resched() is called for the processor. Otherwise, it returns whenever it likes.

() is called at IPL_NONE, without any locks held.

The simplest (and, in some cases, the best) implementation of cpu_idle() is the following.

	void
	cpu_idle(void)
	{
		/* nothing */
	}

cpu_need_resched(9), cpu_switchto(9), intro(9), spl(9)

April 20, 2007 NetBSD-9.2