summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-08-18 06:08:09 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-08-18 06:08:09 +0000
commit49227549413b4f17e45ca23767bc3c3ef2cba81c (patch)
tree8f10e0babd3459a35d71ab6ea2bb41b89809e90a /sys/arch/i386/include
parent080c67550fc82814a4fbea565daca7ebf54c6286 (diff)
make apm use kqueue for transferring events to luse listener.
apparently i thought i comitted this already before apmd. tested by me, art@ and jason@ .
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/apmvar.h16
-rw-r--r--sys/arch/i386/include/conf.h8
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/arch/i386/include/apmvar.h b/sys/arch/i386/include/apmvar.h
index 6f313844fdb..23ec88eab43 100644
--- a/sys/arch/i386/include/apmvar.h
+++ b/sys/arch/i386/include/apmvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmvar.h,v 1.12 2001/06/24 21:17:33 mickey Exp $ */
+/* $OpenBSD: apmvar.h,v 1.13 2001/08/18 06:08:08 mickey Exp $ */
/*
* Copyright (c) 1995 John T. Kohl
@@ -174,7 +174,11 @@
/* 0x0100 - 0x01ff Reserved device events */
/* 0x0200 - 0x02ff OEM-defined APM events */
/* 0x0300 - 0xffff Reserved */
-#define APM_DEFEVENT 0xffffffff /* for customization */
+#define APM_EVENT_MASK 0xffff
+
+#define APM_EVENT_COMPOSE(t,i) ((((i) & 0x7fff) << 16)|((t) & APM_EVENT_MASK))
+#define APM_EVENT_TYPE(e) ((e) & APM_EVENT_MASK)
+#define APM_EVENT_INDEX(e) ((e) >> 16)
#define APM_GET_POWER_STATE 0x530c
#define APM_DEVICE_MGMT_ENABLE 0x530d
@@ -256,12 +260,6 @@
* Sep., 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*/
-struct apm_event_info {
- u_int type;
- u_int index;
- u_int spare[8];
-};
-
#define APM_BATTERY_ABSENT 4
struct apm_power_info {
@@ -282,7 +280,6 @@ struct apm_ctl {
#define APM_IOC_STANDBY _IO('A', 1) /* put system into standby */
#define APM_IOC_SUSPEND _IO('A', 2) /* put system into suspend */
#define APM_IOC_GETPOWER _IOR('A', 3, struct apm_power_info) /* fetch battery state */
-#define APM_IOC_NEXTEVENT _IOR('A', 4, struct apm_event_info) /* fetch event */
#define APM_IOC_DEV_CTL _IOW('A', 5, struct apm_ctl) /* put device into mode */
#define APM_IOC_PRN_CTL _IOW('A', 6, int ) /* driver power status msg */
#define APM_PRINT_ON 0 /* driver power status displayed */
@@ -295,6 +292,7 @@ extern void apm_cpu_busy __P((void));
extern void apm_cpu_idle __P((void));
extern void apminit __P((void));
int apm_set_powstate __P((u_int devid, u_int powstate));
+int apm_kqfilter __P((dev_t dev, struct knote *kn));
#endif /* _KERNEL */
#endif /* _I386_APMVAR_H_ */
diff --git a/sys/arch/i386/include/conf.h b/sys/arch/i386/include/conf.h
index 0646f0e604a..ae3ef445ee5 100644
--- a/sys/arch/i386/include/conf.h
+++ b/sys/arch/i386/include/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.7 1997/09/27 06:31:32 mickey Exp $ */
+/* $OpenBSD: conf.h,v 1.8 2001/08/18 06:08:08 mickey Exp $ */
/* $NetBSD: conf.h,v 1.2 1996/05/05 19:28:34 christos Exp $ */
/*
@@ -54,6 +54,12 @@ cdev_decl(pc);
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
0, seltrue, (dev_type_mmap((*))) enodev }
+#define cdev_apm_init(c,n) {\
+ dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
+ (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
+ (dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
+ (dev_type_mmap((*))) enodev, D_KQFILTER, dev_init(c,n,kqfilter) }
+
cdev_decl(spkr);
cdev_decl(mms);