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
12 .\" $FreeBSD: src/share/man/man4/man4.i386/apm.4,v 1.13.2.5 2001/08/17 13:08:45 ru Exp $
19 .Nd APM BIOS interface
21 .Cd device apm0 at nexus?
24 is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS
26 It has been largely superseded by
30 ioctls (see below) so userland can use them as a uniform interface
31 (to get at the battery status, for example).
38 is not available on the
43 provides the following power management functions.
44 .Bl -enum -offset indent
46 When the system wakes up from suspended mode,
48 adjusts the system clock to RTC.
50 When the system wakes up from suspended mode,
54 comprising of system wakeup time and elapsed time during suspended mode.
57 slows CPU clock when there are no system activities (runnable processes,
59 This function is available only on systems whose APM supports CPU idling.
62 exports an application interface as a character device.
63 Applications can control APM, or retrieve APM status information via this
66 exports the following interfaces.
67 These symbols are defined in
68 .In machine/apm_bios.h .
69 .Bl -tag -width 4n -offset indent
73 Get power management information.
76 Enable / Disable power management.
78 .It Dv APMIO_NOTHALTCPU
79 Control execution of HLT in the kernel context switch routine.
80 .It Dv APMIO_GETPWSTATUS
81 Get per battery information.
83 Some APM implementations execute the HLT
84 (Halt CPU until an interrupt occurs)
87 call, while others do not.
88 Thus enabling this may result in redundant HLT executions because
90 is called from the kernel context switch routine that inherently executes
92 This may reduce peak system performance.
94 Also the system hangs up if HLT instruction is disabled in the kernel
95 context switch routine, and if the APM implementation of the machine
96 does not execute HLT in
98 On some implementations that do not support CPU clock slowdown, APM
99 might not execute HLT.
103 operation on such machines.
105 The current version of
109 from the kernel context switch routine if clock slowdown is not supported,
110 and it executes HLT instruction by default.
111 Therefore, there is no need to use these two operations in most cases.
114 These interfaces are used by
118 polls APM events and handles the following events:
119 .Bl -column PMEV_USERSUSPENDREQ "suspend system" "critical suspend request"
120 .It Sy Name Ta Sy Action Ta Sy Description
121 .It Dv PMEV_STANDBYREQ Ta "suspend system" Ta "standby request"
122 .It Dv PMEV_SUSPENDREQ Ta "suspend system" Ta "suspend request"
123 .It Dv PMEV_USERSUSPENDREQ Ta "suspend system" Ta "user suspend"
124 .It "" Ta "" Ta "request"
125 .It Dv PMEV_CRITSUSPEND Ta "suspend system" Ta "critical suspend"
126 .It "" Ta "" Ta "request"
127 .It Dv PMEV_NORMRESUME Ta "resume system" Ta "normal resume"
128 .It Dv PMEV_CRITRESUME Ta "resume system" Ta "critical resume"
129 .It Dv PMEV_STANDBYRESUME Ta "resume system" Ta "standby resume"
130 .It Dv PMEV_BATTERYLOW Ta "notify message" Ta "battery low"
131 .It Dv PMEV_UPDATETIME Ta "adjust clock" Ta "update time"
138 .An Tatsumi Hosokawa Aq Mt hosokawa@jp.FreeBSD.org
141 Many, if not most, of the implementations of APM-bios in laptops
143 You may be putting your LCD-display and batteries at a risk by using this
145 (The reason this isn't a problem for MS-windows is that they use the
146 real-mode interface.)
147 If you see any weird behavior from your system with this code in use,
148 unplug the power and batteries ASAP, if not immediately, and disable
151 We are very interested in getting this code working, so please send your
152 observations of any anomalous behavior to us.
156 is active, calling the BIOS setup routine by using hot-keys,
157 may cause serious trouble when resuming the system.
158 BIOS setup programs should be called during bootstrap, or from DOS.
160 Some APM implementations cannot handle events such as pushing the
161 power button or closing the cover.
162 On such implementations, the system
171 Disk spin-down, LCD backlight control, and power on demand have not
172 been supported on the current version.