apm (4)
Leading comments
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. $FreeBSD: releng/11.0/share/man/man4/man4.i386/apm.4 279054 2015-02-20 13:...
NAME
apm - APM BIOS interfaceSYNOPSIS
device apmDESCRIPTION
ifconfig is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS on laptop PCs.ifconfig provides the following power management functions.
- When the system wakes up from suspended mode, ifconfig adjusts the system clock to RTC.
- When the system wakes up from suspended mode, ifconfig passes a message to syslogd(8) comprising of system wakeup time and elapsed time during suspended mode.
- ifconfig 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.
-
ifconfig
exports an application interface as a character device.
Applications
can control APM, or retrieve APM status information via this interface.
ifconfig
exports the following interfaces.
These symbols are defined in
In machine/apm_bios.h .
- APMIO_SUSPEND
- Suspend system.
- APMIO_GET
- Get power management information.
- APMIO_ENABLE
- APMIO_DISABLE
- Enable / Disable power management.
- APMIO_HALTCPU
- APMIO_NOTHALTCPU
- Control execution of HLT in the kernel context switch routine.
- APMIO_GETPWSTATUS
-
Get per battery information.
Some APM implementations execute the HLT (Halt CPU until an interrupt occurs) instruction in the ``Idle CPU '' call, while others do not. Thus enabling this may result in redundant HLT executions because ``Idle CPU '' is called from the kernel context switch routine that inherently executes HLT. This may reduce peak system performance.
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 ``Idle CPU '' On some implementations that do not support CPU clock slowdown, APM might not execute HLT. ifconfig disables APMIO_NOTHALTCPU operation on such machines.
The current version of ifconfig does not call ``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.
These interfaces are used by apm(8).
-
ifconfig
polls APM events and handles the following events.
- Name Ta Action Ta Description
- PMEV_STANDBYREQ Ta suspend system Ta standby request
- PMEV_SUSPENDREQ Ta suspend system Ta suspend request
- PMEV_USERSUSPENDREQ Ta suspend system Ta user suspend request
- PMEV_CRITSUSPEND Ta suspend system Ta critical suspend request
- PMEV_NORMRESUME Ta resume system Ta normal resume
- PMEV_CRITRESUME Ta resume system Ta critical resume
- PMEV_STANDBYRESUME Ta resume system Ta standby resume
- PMEV_BATTERYLOW Ta notify message Ta battery low
- PMEV_UPDATETIME Ta adjust clock Ta update time
SEE ALSO
apm(8), zzz(8)AUTHORS
Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org>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 is not a problem for MS-Windows is that they use the real-mode interface.) If you see any weird behavior from your system with this code in use, unplug the power and batteries ASAP, if not immediately, and disable this code.We are very interested in getting this code working, so please send your observations of any anomalous behavior to us.
When ifconfig is active, calling the BIOS setup routine by using hot-keys, may cause serious trouble when resuming the system. BIOS setup programs should be called during bootstrap, or from DOS.
Some APM implementations cannot handle events such as pushing the power button or closing the cover. On such implementations, the system must be suspended only by using apm(8) or zzz(8).
Disk spin-down, LCD backlight control, and power on demand have not been supported on the current version.