aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/include/apm_bios.h
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2000-08-13 17:05:27 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2000-08-13 17:05:27 +0000
commit8ad6d022cafc90588d202d93346e5f079b89b904 (patch)
tree42884a3497eb5804efd3c64c968e373cb835c2ad /sys/i386/include/apm_bios.h
parent5734912a2489bba113213bddda75f8057a7556b1 (diff)
Notes
Diffstat (limited to 'sys/i386/include/apm_bios.h')
-rw-r--r--sys/i386/include/apm_bios.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/i386/include/apm_bios.h b/sys/i386/include/apm_bios.h
index 768d0d75d0b4..52212fe09df3 100644
--- a/sys/i386/include/apm_bios.h
+++ b/sys/i386/include/apm_bios.h
@@ -118,7 +118,12 @@
#define PMDV_PCMCIA1 0x0601
#define PMDV_PCMCIA2 0x0602
#define PMDV_PCMCIA3 0x0603
-/* 0x0700 - 0xdfff Reserved */
+/* 0x0700 - 0x7fff Reserved */
+#define PMDV_BATT_BASE 0x8000
+#define PMDV_BATT0 0x8001
+#define PMDV_BATT1 0x8002
+#define PMDV_BATT_ALL 0x80ff
+/* 0x8100 - 0xdfff Reserved */
/* 0xe000 - 0xefff OEM-defined power device IDs */
/* 0xf000 - 0xffff Reserved */
@@ -220,6 +225,23 @@ typedef struct apm_info {
u_int ai_spare[6]; /* For future expansion */
} *apm_info_t;
+/* Battery flag */
+#define APM_BATT_HIGH 0x01
+#define APM_BATT_LOW 0x02
+#define APM_BATT_CRITICAL 0x04
+#define APM_BATT_CHARGING 0x08
+#define APM_BATT_NOT_PRESENT 0x10
+#define APM_BATT_NO_SYSTEM 0x80
+
+typedef struct apm_pwstatus {
+ u_int ap_device; /* Device code of battery */
+ u_int ap_acline; /* AC line status (0) */
+ u_int ap_batt_stat; /* Battery status (0) */
+ u_int ap_batt_flag; /* Battery flag (0) */
+ u_int ap_batt_life; /* Remaining battery life in percent (0) */
+ int ap_batt_time; /* Remaining battery time in seconds (0) */
+} *apm_pwstatus_t;
+
struct apm_bios_arg {
u_long eax;
u_long ebx;
@@ -245,6 +267,7 @@ struct apm_event_info {
#define APMIO_BIOS _IOWR('P', 10, struct apm_bios_arg)
#define APMIO_GETINFO _IOR('P', 11, struct apm_info)
#define APMIO_STANDBY _IO('P', 12)
+#define APMIO_GETPWSTATUS _IOWR('P', 13, struct apm_pwstatus)
/* for /dev/apmctl */
#define APMIO_NEXTEVENT _IOR('A', 100, struct apm_event_info)
#define APMIO_REJECTLASTREQ _IO('P', 101)