FreeBSD/sys/i386/bios/apm.c
/* inform APM BIOS that CPU is idle */
inform APM BIOS that CPU is idle
inform APM BIOS that CPU is idle
void
apm_cpu_idle(void)
{
	struct apm_softc *sc = &apm_softc;
	if (sc->active) {
		sc->bios.r.eax = (APM_BIOS <<8) | APM_CPUIDLE;
		sc->bios.r.edx = sc->bios.r.ecx = sc->bios.r.ebx = 0;
		(void) apm_bioscall();
	}
	if (!sc->active || sc->always_halt_cpu)
		halt();	
}
void apm_cpu_idle ( void ) { struct apm_softc * sc = & apm_softc ; if ( sc -> active ) { sc -> bios . r . eax = ( APM_BIOS << 8 ) | APM_CPUIDLE ; sc -> bios . r . edx = sc -> bios . r . ecx = sc -> bios . r . ebx = 0 ; ( void ) apm_bioscall ( ) ; } if ( ! sc -> active || sc -> always_halt_cpu ) halt ( ) ; }
inform APM BIOS that CPU is idle
inform APM BIOS that CPU is idle
/*
	 * Some APM implementation halts CPU in BIOS, whenever
	 * "CPU-idle" function are invoked, but swtch() of
	 * FreeBSD halts CPU, therefore, CPU is halted twice
	 * in the sched loop. It makes the interrupt latency
	 * terribly long and be able to cause a serious problem
	 * in interrupt processing. We prevent it by removing
	 * "hlt" operation from swtch() and managed it under
	 * APM driver.
	 */ /* wait for interrupt */