1994-11-01 22:46:40 +00:00
|
|
|
.\" LP (Laptop Package)
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
|
|
|
|
.\"
|
|
|
|
.\" This software may be used, modified, copied, and distributed, in
|
|
|
|
.\" both source and binary form provided that the above copyright and
|
|
|
|
.\" these terms are retained. Under no circumstances is the author
|
|
|
|
.\" responsible for the proper functioning of this software, nor does
|
|
|
|
.\" the author assume any responsibility for damages incurred with its
|
|
|
|
.\" use.
|
1996-12-26 16:16:37 +00:00
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1996-12-26 16:16:37 +00:00
|
|
|
.\"
|
1994-11-01 22:46:40 +00:00
|
|
|
.Dd November 1, 1994
|
1996-12-29 20:36:04 +00:00
|
|
|
.Dt APM 4 i386
|
1994-11-01 22:46:40 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm apm
|
|
|
|
.Nd APM BIOS interface
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Cd device apm0 at isa?
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm apm
|
|
|
|
is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS
|
|
|
|
on laptop PCs.
|
|
|
|
.Pp
|
|
|
|
.Nm apm
|
|
|
|
provides the following power management functions.
|
|
|
|
.Bl -enum -offset indent
|
|
|
|
.It
|
|
|
|
When the system wakes up from suspended mode,
|
|
|
|
.Nm apm
|
|
|
|
adjusts the system clock to RTC.
|
|
|
|
.It
|
|
|
|
When the system wakes up from suspended mode,
|
|
|
|
.Nm apm
|
|
|
|
passes a message to
|
|
|
|
.Xr syslogd 8
|
|
|
|
comprising of system wakeup time and elapsed time during suspended mode.
|
|
|
|
.It
|
|
|
|
.Nm apm
|
|
|
|
slows CPU clock when there are no system activities (runnable processes,
|
|
|
|
interrupts, etc.). This function is available only on systems whose APM
|
|
|
|
supports CPU idling.
|
|
|
|
.It
|
|
|
|
.Nm apm
|
|
|
|
exports an application interface as a character device. Applications
|
|
|
|
can control APM, or retrieve APM status information via this interface.
|
|
|
|
.Nm apm
|
|
|
|
exports the following interfaces. These symbols are defined in
|
|
|
|
.Dq Pa /usr/include/machine/apm_bios.h.
|
|
|
|
.Bl -tag -width 4n -offset indent
|
|
|
|
.It Sy APMIO_SUSPEND
|
|
|
|
Suspend system.
|
|
|
|
.It Sy APMIO_GET
|
|
|
|
Get power management information.
|
|
|
|
.It Sy APMIO_ENABLE
|
|
|
|
.It Sy APMIO_DISABLE
|
|
|
|
Enable / Disable power management.
|
|
|
|
.It Sy APMIO_HALTCPU
|
|
|
|
.It Sy APMIO_NOTHALTCPU
|
|
|
|
Control execution of HLT in the kernel context switch routine.
|
|
|
|
.Pp
|
|
|
|
Some APM implementations execute the HLT
|
|
|
|
.Pq Halt CPU until an interrupt occurs
|
|
|
|
instruction in the
|
|
|
|
.Dq Pa Idle CPU
|
|
|
|
call, while others do not. Thus enabling this may result in
|
|
|
|
redundant HLT executions because
|
|
|
|
.Dq Pa Idle CPU
|
|
|
|
is called from the kernel context switch routine that inherently executes
|
|
|
|
HLT. This may reduce peak system performance.
|
|
|
|
.Pp
|
|
|
|
Also the system hangs up if HLT instruction is disabled in the kernel
|
|
|
|
context switch routine, and if the APM implementation of the machine
|
|
|
|
does not execute HLT in
|
|
|
|
.Dq Pa Idle CPU.
|
|
|
|
On some implementations that do not support CPU clock slowdown, APM
|
|
|
|
might not execute HLT.
|
|
|
|
.Nm apm
|
|
|
|
disables
|
|
|
|
.Sy APMIO_NOTHALTCPU
|
|
|
|
operation on such machines.
|
|
|
|
.Pp
|
|
|
|
The current version of
|
|
|
|
.Nm apm
|
|
|
|
does not call
|
|
|
|
.Dq Pa Idle CPU
|
|
|
|
from the kernel context switch routine if clock slowdown is not supported,
|
|
|
|
and it executes HLT instruction by default. Therefore, there is
|
|
|
|
no need to use these two operations in most cases.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
These interfaces are used by
|
|
|
|
.Xr apm 8
|
|
|
|
and
|
|
|
|
.Xr apmconf 8 .
|
|
|
|
.It
|
|
|
|
.Nm apm
|
|
|
|
polls APM events and handles the following events.
|
|
|
|
.Bl -column PMEV_POWERSTATECHANGEXXX "suspend system xxxxx"
|
|
|
|
.It Sy "Name " "Action " "Description"
|
|
|
|
.It Dv "PMEV_STANDBYREQ " No "suspend system " "standby request"
|
|
|
|
.It Dv "PMEV_SUSPENDREQ " No "suspend system " "suspend request"
|
|
|
|
.It Dv "PMEV_USERSUSPENDREQ " No "suspend system " "user suspend request"
|
|
|
|
.It Dv "PMEV_CRITSUSPEND " No "suspend system " "critical suspend request"
|
|
|
|
.It Dv "PMEV_NORMRESUME " No "resume system " "normal resume"
|
|
|
|
.It Dv "PMEV_CRITRESUME " No "resume system " "critical resume"
|
|
|
|
.It Dv "PMEV_STANDBYRESUME " No "resume system " "standby resume"
|
|
|
|
.It Dv "PMEV_BATTERYLOW " No "notify message " "battery low"
|
|
|
|
.It Dv "PMEV_UPDATETIME " No "adjust clock " "update time"
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Sh BUGS
|
|
|
|
WARNING! Many, if not most, of the implementations of APM-bios in laptops
|
|
|
|
today are buggy. You may be putting your LCD-display and batteries at
|
|
|
|
a risk by using this interface. (The reason this isn't a problem for
|
|
|
|
MS-windows is that they use the real-mode interface.) If you see any
|
1998-12-18 03:08:57 +00:00
|
|
|
weird behavior from your system with this code in use, unplug the
|
1998-06-08 06:12:02 +00:00
|
|
|
power and batteries ASAP, if not immediately, and disable this code.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
|
|
|
We are very interested in getting this code working, so please send you
|
1998-12-18 03:08:57 +00:00
|
|
|
observations of any anomalous behavior to us.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
|
|
|
When
|
|
|
|
.Nm apm
|
1998-12-18 03:08:57 +00:00
|
|
|
is active, calling the BIOS setup routine by using hot-keys,
|
1994-11-01 22:46:40 +00:00
|
|
|
may cause serious trouble when resuming the system.
|
|
|
|
BIOS setup programs should be called during bootstrap, or from DOS.
|
|
|
|
.Pp
|
|
|
|
Some APM implementations cannot handle events such as pushing the
|
|
|
|
power button or closing the cover. On such implementations, the system
|
|
|
|
.Ar must
|
|
|
|
be suspended
|
|
|
|
.Ar only
|
|
|
|
by using
|
|
|
|
.Xr apm 8
|
|
|
|
or
|
|
|
|
.Xr zzz 8 .
|
|
|
|
.Pp
|
1998-12-18 03:08:57 +00:00
|
|
|
Disk spin-down, LCD backlight control, and power on demand have not
|
1994-11-01 22:46:40 +00:00
|
|
|
been supported on the current version.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr apm 8 ,
|
1996-12-26 16:16:37 +00:00
|
|
|
.Xr apmconf 8 ,
|
|
|
|
.Xr zzz 8
|
1999-08-15 10:48:36 +00:00
|
|
|
.Sh AUTHORS
|
1998-02-20 07:19:51 +00:00
|
|
|
Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org>
|