Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / share / man / man4 / man4.i386 / apm.4
1 .\" LP (Laptop Package)
2 .\"
3 .\" Copyright (c) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
4 .\"
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
10 .\" use.
11 .\"
12 .\" $FreeBSD: src/share/man/man4/man4.i386/apm.4,v 1.13.2.5 2001/08/17 13:08:45 ru Exp $
13 .\" $DragonFly: src/share/man/man4/man4.i386/apm.4,v 1.7 2007/12/16 01:26:34 swildner Exp $
14 .\"
15 .Dd November 1, 1994
16 .Dt APM 4 i386
17 .Os
18 .Sh NAME
19 .Nm apm
20 .Nd APM BIOS interface
21 .Sh SYNOPSIS
22 .Cd device apm0 at nexus?
23 .Sh DESCRIPTION
24 .Nm
25 is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS
26 on laptop PCs.
27 .Pp
28 .Nm
29 provides the following power management functions.
30 .Bl -enum -offset indent
31 .It
32 When the system wakes up from suspended mode,
33 .Nm
34 adjusts the system clock to RTC.
35 .It
36 When the system wakes up from suspended mode,
37 .Nm
38 passes a message to
39 .Xr syslogd 8
40 comprising of system wakeup time and elapsed time during suspended mode.
41 .It
42 .Nm
43 slows CPU clock when there are no system activities (runnable processes,
44 interrupts, etc.).
45 This function is available only on systems whose APM supports CPU idling.
46 .It
47 .Nm
48 exports an application interface as a character device.
49 Applications can control APM, or retrieve APM status information via this
50 interface.
51 .Nm
52 exports the following interfaces.
53 These symbols are defined in
54 .In machine/apm_bios.h .
55 .Bl -tag -width 4n -offset indent
56 .It Dv APMIO_SUSPEND
57 Suspend system.
58 .It Dv APMIO_GETINFO
59 Get power management information.
60 .It Dv APMIO_ENABLE
61 .It Dv APMIO_DISABLE
62 Enable / Disable power management.
63 .It Dv APMIO_HALTCPU
64 .It Dv APMIO_NOTHALTCPU
65 Control execution of HLT in the kernel context switch routine.
66 .It Dv APMIO_GETPWSTATUS
67 Get per battery information.
68 .Pp
69 Some APM implementations execute the HLT
70 (Halt CPU until an interrupt occurs)
71 instruction in the
72 .Dq Em Idle CPU
73 call, while others do not.
74 Thus enabling this may result in redundant HLT executions because
75 .Dq Em Idle CPU
76 is called from the kernel context switch routine that inherently executes
77 HLT.
78 This may reduce peak system performance.
79 .Pp
80 Also the system hangs up if HLT instruction is disabled in the kernel
81 context switch routine, and if the APM implementation of the machine
82 does not execute HLT in
83 .Dq Em Idle CPU .
84 On some implementations that do not support CPU clock slowdown, APM
85 might not execute HLT.
86 .Nm
87 disables
88 .Dv APMIO_NOTHALTCPU
89 operation on such machines.
90 .Pp
91 The current version of
92 .Nm
93 does not call
94 .Dq Em Idle CPU
95 from the kernel context switch routine if clock slowdown is not supported,
96 and it executes HLT instruction by default.
97 Therefore, there is no need to use these two operations in most cases.
98 .El
99 .Pp
100 These interfaces are used by
101 .Xr apm 8 .
102 .It
103 .Nm
104 polls APM events and handles the following events.
105 .Bl -column PMEV_POWERSTATECHANGEXXX "suspend system xxxxx"
106 .It Sy "Name                  " "Action          " "Description"
107 .It Dv "PMEV_STANDBYREQ       " No "suspend system  " "standby request"
108 .It Dv "PMEV_SUSPENDREQ       " No "suspend system  " "suspend request"
109 .It Dv "PMEV_USERSUSPENDREQ   " No "suspend system  " "user suspend request"
110 .It Dv "PMEV_CRITSUSPEND      " No "suspend system  " "critical suspend request"
111 .It Dv "PMEV_NORMRESUME       " No "resume system   " "normal resume"
112 .It Dv "PMEV_CRITRESUME       " No "resume system   " "critical resume"
113 .It Dv "PMEV_STANDBYRESUME    " No "resume system   " "standby resume"
114 .It Dv "PMEV_BATTERYLOW       " No "notify message  " "battery low"
115 .It Dv "PMEV_UPDATETIME       " No "adjust clock    " "update time"
116 .El
117 .El
118 .Sh SEE ALSO
119 .Xr apm 8 ,
120 .Xr zzz 8
121 .Sh AUTHORS
122 .An Tatsumi Hosokawa Aq hosokawa@jp.FreeBSD.org
123 .Sh BUGS
124 WARNING!
125 Many, if not most, of the implementations of APM-bios in laptops
126 today are buggy.
127 You may be putting your LCD-display and batteries at a risk by using this
128 interface.
129 (The reason this isn't a problem for MS-windows is that they use the
130 real-mode interface.)
131 If you see any weird behavior from your system with this code in use,
132 unplug the power and batteries ASAP, if not immediately, and disable
133 this code.
134 .Pp
135 We are very interested in getting this code working, so please send your
136 observations of any anomalous behavior to us.
137 .Pp
138 When
139 .Nm
140 is active, calling the BIOS setup routine by using hot-keys,
141 may cause serious trouble when resuming the system.
142 BIOS setup programs should be called during bootstrap, or from DOS.
143 .Pp
144 Some APM implementations cannot handle events such as pushing the
145 power button or closing the cover.
146 On such implementations, the system
147 .Ar must
148 be suspended
149 .Ar only
150 by using
151 .Xr apm 8
152 or
153 .Xr zzz 8 .
154 .Pp
155 Disk spin-down, LCD backlight control, and power on demand have not
156 been supported on the current version.