View | Details | Raw Unified | Return to bug 18162
Collapse All | Expand All

(-)sys/i386/apm/apm.c (+23 lines)
Lines 219-224 Link Here
219
	return (apm_bioscall());
219
	return (apm_bioscall());
220
}
220
}
221
 
221
 
222
/* enable/disable timer-based standby/suspend requests (APM 1.2 or later) */
223
static int
224
apm_enable_disable_timer_req(int enable)
225
{
226
	struct apm_softc *sc = &apm_softc;
227
228
	sc->bios.r.eax = (APM_BIOS << 8) | APM_TIMERREQUESTS;
229
	sc->bios.r.ebx = PMDV_APMBIOS;
230
	sc->bios.r.ecx = enable;
231
	sc->bios.r.edx = 0;
232
	return (apm_bioscall());
233
}
234
222
/* get PM event */
235
/* get PM event */
223
static u_int
236
static u_int
224
apm_getevent(void)
237
apm_getevent(void)
Lines 1072-1077 Link Here
1072
			printf("apm: *Warning* engage function failed err=[%x]",
1085
			printf("apm: *Warning* engage function failed err=[%x]",
1073
				(sc->bios.r.eax >> 8) & 0xff);
1086
				(sc->bios.r.eax >> 8) & 0xff);
1074
			printf(" (Docked or using external power?).\n");
1087
			printf(" (Docked or using external power?).\n");
1088
#endif
1089
		}
1090
	}
1091
1092
	/* disable timer requests, if flag 0x40 is set (APM 1.2 or later) */
1093
	if (sc->intversion >= INTVERSION(1, 2) && (flags & 0x40)) {
1094
		if (apm_enable_disable_timer_req(0)) {
1095
#ifdef APM_DEBUG
1096
			printf("apm: *Warning* timer request function failed! [%x]\n",
1097
				(sc->bios.r.eax >> 8) & 0xff);
1075
#endif
1098
#endif
1076
		}
1099
		}
1077
	}
1100
	}

Return to bug 18162