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