Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips/dev handle pointer type event message and s...
details: https://anonhg.NetBSD.org/src/rev/814031d371b1
branches: trunk
changeset: 501566:814031d371b1
user: sato <sato%NetBSD.org@localhost>
date: Thu Jan 04 07:43:37 2001 +0000
description:
handle pointer type event message and scaler type event message
for CONFIG_HOOK_PMEVENT_*.
diffstat:
sys/arch/hpcmips/dev/hpcapm.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (46 lines):
diff -r 4441129ab860 -r 814031d371b1 sys/arch/hpcmips/dev/hpcapm.c
--- a/sys/arch/hpcmips/dev/hpcapm.c Thu Jan 04 07:09:47 2001 +0000
+++ b/sys/arch/hpcmips/dev/hpcapm.c Thu Jan 04 07:43:37 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hpcapm.c,v 1.5 2000/12/29 08:12:08 sato Exp $ */
+/* $NetBSD: hpcapm.c,v 1.6 2001/01/04 07:43:37 sato Exp $ */
/*
* Copyright (c) 2000 Takemura Shin
@@ -179,11 +179,18 @@
struct apmhpc_softc *sc;
int s;
int charge;
+ int message;
sc = ctx;
if (type != CONFIG_HOOK_PMEVENT)
return 1;
+
+ if (CONFIG_HOOK_VALUEP(msg))
+ message = (int)msg;
+ else
+ message = *(int *)msg;
+
s = splhigh();
switch (id) {
case CONFIG_HOOK_PMEVENT_STANDBYREQ:
@@ -202,7 +209,7 @@
}
break;
case CONFIG_HOOK_PMEVENT_BATTERY:
- switch (*(int *)msg) {
+ switch (message) {
case CONFIG_HOOK_BATT_CRITICAL:
DPRINTF(("hpcapm: battery state critical\n"));
charge = sc->battery_state&APM_BATT_FLAG_CHARGING;
@@ -251,7 +258,7 @@
}
break;
case CONFIG_HOOK_PMEVENT_AC:
- switch (*(int *)msg) {
+ switch (message) {
case CONFIG_HOOK_AC_OFF:
DPRINTF(("hpcapm: ac not connect\n"));
sc->battery_state &= ~APM_BATT_FLAG_CHARGING;
Home |
Main Index |
Thread Index |
Old Index