freebsd5/sys/i386/apm/apm.c
/* Display control */
/*
 * Experimental implementation: My laptop machine can't handle this function
 * If your laptop can control the display via APM, please inform me.
 *                            HOSOKAWA, Tatsumi <hosokawa@jp.FreeBSD.org>
 */
Display control
Experimental implementation: My laptop machine can't handle this function
If your laptop can control the display via APM, please inform me.
HOSOKAWA, Tatsumi 
Display control Experimental implementation : My laptop machine can ' t handle this function If your laptop can control the display via APM please inform me . HOSOKAWA Tatsumi
int
apm_display(int newstate)
{
	struct apm_softc *sc = &apm_softc;
	sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE;
	sc->bios.r.ebx = PMDV_DISP0;
	sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND;
	sc->bios.r.edx = 0;
	if (apm_bioscall() == 0) {
		return 0;
 	}
	sc->bios.r.eax = (APM_BIOS << 8) | APM_SETPWSTATE;
	sc->bios.r.ebx = PMDV_DISPALL;	
	sc->bios.r.ecx = newstate ? PMST_APMENABLED:PMST_SUSPEND;
	sc->bios.r.edx = 0;
	if (apm_bioscall() == 0) {
		return 0;
 	}
 	printf("Display off failure: errcode = %d\n",
	       0xff & (sc->bios.r.eax >> 8));
 	return 1;
}
int apm_display ( int newstate ) { struct apm_softc * sc = & apm_softc ; sc -> bios . r . eax = ( APM_BIOS << 8 ) | APM_SETPWSTATE ; sc -> bios . r . ebx = PMDV_DISP0 ; sc -> bios . r . ecx = newstate ? PMST_APMENABLED : PMST_SUSPEND ; sc -> bios . r . edx = 0 ; if ( apm_bioscall ( ) == 0 ) { return 0 ; } sc -> bios . r . eax = ( APM_BIOS << 8 ) | APM_SETPWSTATE ; sc -> bios . r . ebx = PMDV_DISPALL ; sc -> bios . r . ecx = newstate ? PMST_APMENABLED : PMST_SUSPEND ; sc -> bios . r . edx = 0 ; if ( apm_bioscall ( ) == 0 ) { return 0 ; } printf ( " \n " , 0xff & ( sc -> bios . r . eax >> 8 ) ) ; return 1 ; }
Display control
 Experimental implementation: My laptop machine can't handle this function
 If your laptop can control the display via APM, please inform me.
Display control Experimental implementation : My laptop machine can ' t handle this function If your laptop can control the display via APM please inform me .
/* If failed, then try to blank all display devices instead. */ /* all display devices */