summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2005-03-29 23:17:46 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2005-03-29 23:17:46 +0000
commitb2381d12a928d269d910c97f848127d4fefc95e5 (patch)
tree612d94c44b977cd753d1ecb5ae53228bbed37011 /sys/arch
parentfdf937e31a009b5b2dc1554a3e68e17fd27b44e7 (diff)
Handle apm_battlow flag by suspending, and clear all flags after resume.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/xscale/pxa2x0_apm.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c
index c0b59c1c558..b1b03b334ee 100644
--- a/sys/arch/arm/xscale/pxa2x0_apm.c
+++ b/sys/arch/arm/xscale/pxa2x0_apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_apm.c,v 1.8 2005/03/03 22:55:00 uwe Exp $ */
+/* $OpenBSD: pxa2x0_apm.c,v 1.9 2005/03/29 23:17:45 uwe Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -76,7 +76,7 @@ struct cfdriver apm_cd = {
int apm_userstandbys;
int apm_suspends;
-int apm_battlow; /* XXX unused */
+int apm_battlow;
/* battery percentage at where we get verbose in our warnings. This
value can be changed using sysctl(8), value machdep.apmwarn.
@@ -310,10 +310,6 @@ apm_suspend(struct pxa2x0_apm_softc *sc)
if (cold)
vfs_syncwait(0);
- /* Clear pending standby and suspend requests. */
- apm_userstandbys = 0;
- apm_suspends = 0;
-
pxa2x0_apm_sleep((struct pxa2x0_apm_softc *)sc);
}
@@ -383,7 +379,6 @@ apm_periodic_check(struct pxa2x0_apm_softc *sc)
{
u_long event_type;
- /* Loop until all events are handled. */
while (1) {
if (apm_get_event(sc, &event_type) != 0)
break;
@@ -391,15 +386,11 @@ apm_periodic_check(struct pxa2x0_apm_softc *sc)
break;
}
- /*
- * Counters for pending requests are cleared just before changing
- * the processor run mode to avoid falling back to sleep after a
- * wake-up event.
- */
- if (apm_suspends || apm_userstandbys) {
+ if (apm_battlow || apm_suspends || apm_userstandbys) {
apm_suspend(sc);
apm_resume(sc);
}
+ apm_battlow = apm_suspends = apm_userstandbys = 0;
}
void