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