From nobody Wed Sep 30 16:27:37 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hw0nj4Zd9z6tn31 for ; Wed, 30 Sep 2026 16:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hw0nj3NCNz4bm0 for ; Wed, 30 Sep 2026 16:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790785657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2A5eTD8d8OLxADo0n/qQZmLIr0nHbPF2zlS66oqPp3Q=; b=gfo43bQRZWT32wDphfFZdyakVHbxtXgd6rVU4hJf5jhWLoTqVO1M9P154SITAslxL3w5Uv mwM78sKnxdlcZrFUcvYmczcPNJ7h8bKXSAK6YMbGpL4q7Zq1NTNHlBADHH5jMYWF1uOr8z nM2gqub2/UAmCl0mxgLL9+Z+4TCXI2dJDwA/laboP1T81dERC0NsUcNAypNEeeBvWJegK1 x+ZrShqQOlIif6iTAeOmztP6MFaUFNK6ujDEjsCPI0+Vmlrq58dkmVCrIErDm/X91e9e50 KBJGeRdeZSLnClWYG6Ld/Pt0q2qFUUd82z8mXw4wQychAMmHITiDbd8nUn1dhA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790785657; b=xVBf/5vq6wGnYLpbAZ55NEQTCqX8p32rQAZVLfZJMqwdHvAoONJG5wrYiZRION6C212Vct 0YxQf9Q2pNO8X0pR2n9qM5ENf/2UYgpmFGLnrl3UTtqOip1vOBSqNmh7qacZlEAciBQXjq mp/lzD82m55PlSEFIefPstc43+inQEJxC2QH/yOp/+PbqQJTIEyrlbuRZ4i7ZgcqJ06+bJ 3T+lZ0pHUDyrpDwxuUbR2bakrQHQAiDgD/2T34QudYwCa3Mrlrx5OD3iCdgZNu3fZEXXPI yR7Z1cO90l2AjOVbXKglhqSNCm7H+NZvB0csC6exurdrubTIL+F6nwcIv+idcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790785657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2A5eTD8d8OLxADo0n/qQZmLIr0nHbPF2zlS66oqPp3Q=; b=BD+jj06O2Jr/QIJneiF6N95le61XXdjqAI6gkV0CRVCFZUkWP/vghS5g83WmXuI5ZXthiQ v5bS+9gYErlOygmX44iynqYPqfyytiGaG3Omlq8BpJJ1lsJWTETKjwifHXr5xZyBTOWlai 3nxO4S0Y2+6t+yVoUmkIduwxM5rEF30su3xf4jYywBW4rJ5p/+9+vHmJbuEYsmmQC57udY mlTIJznKPP1oHd0mV9yfHocFGoRNdCDAxC1wYn7LWFrqI52aA84ztlLcqU0Lt3xQ9qA2LY gLgwhWlpi0DqcCyea+Al72g2x+sSZofZE5q9qqB0zE0pKw2eVh9/4lCGzZXW7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hw0nj2RqCzspQ for ; Wed, 30 Sep 2026 16:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37666 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 30 Sep 2026 16:27:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: e10eb35d2523 - main - apm.4: Trim down to describing the compat interface exposed by acpi(4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e10eb35d25233283fef43abbc7e1c24ddd8a2877 Auto-Submitted: auto-generated Date: Wed, 30 Sep 2026 16:27:37 +0000 Message-Id: <6abd3879.37666.4879fdb2@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e10eb35d25233283fef43abbc7e1c24ddd8a2877 commit e10eb35d25233283fef43abbc7e1c24ddd8a2877 Author: John Baldwin AuthorDate: 2026-09-30 16:21:06 +0000 Commit: John Baldwin CommitDate: 2026-09-30 16:21:06 +0000 apm.4: Trim down to describing the compat interface exposed by acpi(4) Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D59938 --- ObsoleteFiles.inc | 3 + share/man/man4/Makefile | 2 + share/man/man4/apm.4 | 53 +++++++++++++ share/man/man4/man4.i386/Makefile | 3 +- share/man/man4/man4.i386/apm.4 | 159 -------------------------------------- 5 files changed, 59 insertions(+), 161 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 39df19deb432..9aa4ac8ac829 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20260930: apm(4) not i386-specific +OLD_FILES+=usr/share/man/man4/i386/apm.4.gz + # 20260930: apmd(8) removed OLD_FILES+=etc/apmd.conf OLD_FILES+=etc/rc.d/apmd diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 4c1321c1d785..5d50c2d91bf7 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -57,6 +57,7 @@ MAN= aac.4 \ ${_bxe.4} \ ${_aout.4} \ ${_apic.4} \ + ${_apm.4} \ aq.4 \ arcmsr.4 \ arswitch.4 \ @@ -875,6 +876,7 @@ _acpi_wmi.4= acpi_wmi.4 _aesni.4= aesni.4 _aout.4= aout.4 _apic.4= apic.4 +_apm.4= apm.4 _atrtc.4= atrtc.4 _attimer.4= attimer.4 _aibs.4= aibs.4 diff --git a/share/man/man4/apm.4 b/share/man/man4/apm.4 new file mode 100644 index 000000000000..9add6ffc7edb --- /dev/null +++ b/share/man/man4/apm.4 @@ -0,0 +1,53 @@ +.\" LP (Laptop Package) +.\" +.\" Copyright (c) 1994 by HOSOKAWA, Tatsumi +.\" +.\" 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. +.\" +.Dd September 30, 2026 +.Dt APM 4 amd64 +.Os +.Sh NAME +.Nm apm +.Nd power management interface +.Sh DESCRIPTION +.Nm +is an interface to power management on i386 and amd64. +This interface was originally designed to support the Advanced Power Management +(APM) BIOS extension on i386. +However, the interface is now implemented by +.Xr acpi 4. +.Pp +.Nm +exports an application interface as a character device. +Applications such as +.Xr apm 8 +can control APM, or retrieve APM status information via this interface. +The following +.Xr ioctl 2 +commands are defined in +.In machine/apm_bios.h : +.Bl -tag -width 4n -offset indent +.It Sy APMIO_SUSPEND +Suspend system (typically using S3). +.It Sy APMIO_GETINFO +Get power management information. +.It Sy APMIO_STANDBY +Suspend system (typically using S1). +.It Sy APMIO_GETPWSTATUS +Get per battery information. +.El +.Sh FILES +.Bl -tag -width "/dev/apm" -compact +.It Pa /dev/apm +.El +.Sh SEE ALSO +.Xr apm 8 , +.Xr zzz 8 +.Sh AUTHORS +.An Tatsumi Hosokawa Aq Mt hosokawa@jp.FreeBSD.org diff --git a/share/man/man4/man4.i386/Makefile b/share/man/man4/man4.i386/Makefile index 1136de341947..59f4cc6bea5d 100644 --- a/share/man/man4/man4.i386/Makefile +++ b/share/man/man4/man4.i386/Makefile @@ -1,5 +1,4 @@ -MAN= apm.4 \ - CPU_ELAN.4 \ +MAN= CPU_ELAN.4 \ glxiic.4 \ glxsb.4 \ longrun.4 \ diff --git a/share/man/man4/man4.i386/apm.4 b/share/man/man4/man4.i386/apm.4 deleted file mode 100644 index 48248e8a4cdd..000000000000 --- a/share/man/man4/man4.i386/apm.4 +++ /dev/null @@ -1,159 +0,0 @@ -.\" LP (Laptop Package) -.\" -.\" Copyright (c) 1994 by HOSOKAWA, Tatsumi -.\" -.\" 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. -.\" -.Dd November 1, 1994 -.Dt APM 4 i386 -.Os -.Sh NAME -.Nm apm -.Nd APM BIOS interface -.Sh SYNOPSIS -.Cd device apm -.Sh DEPRECATION NOTICE -This driver is scheduled for removal prior to the release of -.Fx 13.0 . -.Sh DESCRIPTION -.Nm -is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS -on laptop PCs. -.Pp -.Nm -provides the following power management functions. -.Bl -enum -offset indent -.It -When the system wakes up from suspended mode, -.Nm -adjusts the system clock to RTC. -.It -When the system wakes up from suspended mode, -.Nm -passes a message to -.Xr syslogd 8 -comprising of system wakeup time and elapsed time during suspended mode. -.It -.Nm -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 -exports an application interface as a character device. -Applications -can control APM, or retrieve APM status information via this interface. -.Nm -exports the following interfaces. -These symbols are defined in -.In 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. -.It Sy APMIO_GETPWSTATUS -Get per battery information. -.Pp -Some APM implementations execute the HLT -(Halt CPU until an interrupt occurs) -instruction in the -.Dq Em Idle CPU -call, while others do not. -Thus enabling this may result in -redundant HLT executions because -.Dq Em 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 Em Idle CPU . -On some implementations that do not support CPU clock slowdown, APM -might not execute HLT. -.Nm -disables -.Sy APMIO_NOTHALTCPU -operation on such machines. -.Pp -The current version of -.Nm -does not call -.Dq Em 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 . -.It -.Nm -polls APM events and handles the following events. -.Bl -column "xxxxxxxxxxxxxxxxx" "xxxxxxxxxxxxx" "xxxxxxxx" -.It Sy "Name" Ta Sy "Action" Ta Sy "Description" -.It Dv "PMEV_STANDBYREQ" Ta No "suspend system" Ta "standby request" -.It Dv "PMEV_SUSPENDREQ" Ta No "suspend system" Ta "suspend request" -.It Dv "PMEV_USERSUSPENDREQ" Ta No "suspend system" Ta "user suspend request" -.It Dv "PMEV_CRITSUSPEND" Ta No "suspend system" Ta "critical suspend request" -.It Dv "PMEV_NORMRESUME" Ta No "resume system" Ta "normal resume" -.It Dv "PMEV_CRITRESUME" Ta No "resume system" Ta "critical resume" -.It Dv "PMEV_STANDBYRESUME" Ta No "resume system" Ta "standby resume" -.It Dv "PMEV_BATTERYLOW" Ta No "notify message" Ta "battery low" -.It Dv "PMEV_UPDATETIME" Ta No "adjust clock" Ta "update time" -.El -.El -.Sh SEE ALSO -.Xr apm 8 , -.Xr zzz 8 -.Sh AUTHORS -.An Tatsumi Hosokawa Aq Mt hosokawa@jp.FreeBSD.org -.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 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. -.Pp -We are very interested in getting this code working, so please send your -observations of any anomalous behavior to us. -.Pp -When -.Nm -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. -.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 -Disk spin-down, LCD backlight control, and power on demand have not -been supported on the current version.