1 .\" LP (Laptop Package)
3 .\" Copyright (c) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
5 .\" This software may be used, modified, copied, and distributed, in
6 .\" both source and binary form provided that the above copyright and
7 .\" these terms are retained. Under no circumstances is the author
8 .\" responsible for the proper functioning of this software, nor does
9 .\" the author assume any responsibility for damages incurred with its
19 .Nd APM BIOS interface
21 .Cd device apm0 at nexus?
24 is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS
28 provides the following power management functions.
29 .Bl -enum -offset indent
31 When the system wakes up from suspended mode,
33 adjusts the system clock to RTC.
35 When the system wakes up from suspended mode,
39 comprising of system wakeup time and elapsed time during suspended mode.
42 slows CPU clock when there are no system activities (runnable processes,
43 interrupts, etc.). This function is available only on systems whose APM
47 exports an application interface as a character device. Applications
48 can control APM, or retrieve APM status information via this interface.
50 exports the following interfaces. These symbols are defined in
51 .Dq Pa /usr/include/machine/apm_bios.h.
52 .Bl -tag -width 4n -offset indent
56 Get power management information.
59 Enable / Disable power management.
61 .It Sy APMIO_NOTHALTCPU
62 Control execution of HLT in the kernel context switch routine.
64 Some APM implementations execute the HLT
65 .Pq Halt CPU until an interrupt occurs
68 call, while others do not. Thus enabling this may result in
69 redundant HLT executions because
71 is called from the kernel context switch routine that inherently executes
72 HLT. This may reduce peak system performance.
74 Also the system hangs up if HLT instruction is disabled in the kernel
75 context switch routine, and if the APM implementation of the machine
76 does not execute HLT in
78 On some implementations that do not support CPU clock slowdown, APM
79 might not execute HLT.
83 operation on such machines.
85 The current version of
89 from the kernel context switch routine if clock slowdown is not supported,
90 and it executes HLT instruction by default. Therefore, there is
91 no need to use these two operations in most cases.
94 These interfaces are used by
98 polls APM events and handles the following events.
99 .Bl -column PMEV_POWERSTATECHANGEXXX "suspend system xxxxx"
100 .It Sy "Name " "Action " "Description"
101 .It Dv "PMEV_STANDBYREQ " No "suspend system " "standby request"
102 .It Dv "PMEV_SUSPENDREQ " No "suspend system " "suspend request"
103 .It Dv "PMEV_USERSUSPENDREQ " No "suspend system " "user suspend request"
104 .It Dv "PMEV_CRITSUSPEND " No "suspend system " "critical suspend request"
105 .It Dv "PMEV_NORMRESUME " No "resume system " "normal resume"
106 .It Dv "PMEV_CRITRESUME " No "resume system " "critical resume"
107 .It Dv "PMEV_STANDBYRESUME " No "resume system " "standby resume"
108 .It Dv "PMEV_BATTERYLOW " No "notify message " "battery low"
109 .It Dv "PMEV_UPDATETIME " No "adjust clock " "update time"
113 WARNING! Many, if not most, of the implementations of APM-bios in laptops
114 today are buggy. You may be putting your LCD-display and batteries at
115 a risk by using this interface. (The reason this isn't a problem for
116 MS-windows is that they use the real-mode interface.) If you see any
117 weird behavior from your system with this code in use, unplug the
118 power and batteries ASAP, if not immediately, and disable this code.
120 We are very interested in getting this code working, so please send you
121 observations of any anomalous behavior to us.
125 is active, calling the BIOS setup routine by using hot-keys,
126 may cause serious trouble when resuming the system.
127 BIOS setup programs should be called during bootstrap, or from DOS.
129 Some APM implementations cannot handle events such as pushing the
130 power button or closing the cover. On such implementations, the system
139 Disk spin-down, LCD backlight control, and power on demand have not
140 been supported on the current version.
145 Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org>