From e4f76d8fcfb26ac1d721fcb3c7430d3e90182e24 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Thu, 22 Feb 2018 07:50:13 +0100 Subject: [PATCH] kernel/acpi: Remove the old APM emulation code. This is no longer needed by anything. The header with APM ioctl defines can go as well. While here, do a little adjustment of comments and manual pages too. Pointed-out-by: ivadasz --- Makefile_upgrade.inc | 1 + etc/rc.resume | 2 +- etc/rc.suspend | 2 +- share/man/man9/ioctl.9 | 4 +- sys/platform/pc64/acpica/acpi_machdep.c | 430 ++++++-------------------------- sys/platform/pc64/include/apm_bios.h | 267 -------------------- sys/sys/kbio.h | 4 +- sys/sys/param.h | 3 +- usr.sbin/kbdcontrol/kbdmap.5 | 5 +- 9 files changed, 89 insertions(+), 629 deletions(-) rewrite sys/platform/pc64/acpica/acpi_machdep.c (69%) delete mode 100644 sys/platform/pc64/include/apm_bios.h diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index 71f25dbdb6..f3bf807b9a 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -3371,6 +3371,7 @@ TO_REMOVE+=/usr/share/man/man8/rshd.8.gz TO_REMOVE+=/usr/share/calendar/de_AT.ISO_8859-15 TO_REMOVE+=/usr/share/man/man9/timeout.9.gz TO_REMOVE+=/usr/share/man/man9/untimeout.9.gz +TO_REMOVE+=/usr/include/machine/apm_bios.h .if !defined(WANT_INSTALLER) TO_REMOVE+=/usr/sbin/dfuibe_installer diff --git a/etc/rc.resume b/etc/rc.resume index 6f0b211ac7..f063bce4da 100644 --- a/etc/rc.resume +++ b/etc/rc.resume @@ -27,7 +27,7 @@ # $FreeBSD: src/etc/rc.resume,v 1.9 2008/07/21 22:55:40 thompsa Exp $ # -# sample run command file for APM Resume Event +# sample run command file for ACPI Resume Event if [ $# -ne 2 ]; then echo "Usage: $0 [acpi] [standby,suspend|1-4]" diff --git a/etc/rc.suspend b/etc/rc.suspend index 453afa8ec5..e363ff65ab 100644 --- a/etc/rc.suspend +++ b/etc/rc.suspend @@ -27,7 +27,7 @@ # $FreeBSD: src/etc/rc.suspend,v 1.6 2004/01/21 03:03:40 njl Exp $ # -# sample run command file for APM Suspend Event +# sample run command file for ACPI Suspend Event if [ $# -ne 2 ]; then echo "Usage: $0 [acpi] [standby,suspend|1-5]" diff --git a/share/man/man9/ioctl.9 b/share/man/man9/ioctl.9 index cd684d66f3..255533a14f 100644 --- a/share/man/man9/ioctl.9 +++ b/share/man/man9/ioctl.9 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 17, 2017 +.Dd February 22, 2018 .Dt IOCTL 9 .Os .Sh NAME @@ -141,8 +141,6 @@ and .Xr ppbus 4 .It 'p' .Xr procfs 5 -.It 'P' -.Nm apm (deprecated) .It 'q' .Pa /dev/sequencer .It 'r' diff --git a/sys/platform/pc64/acpica/acpi_machdep.c b/sys/platform/pc64/acpica/acpi_machdep.c dissimilarity index 69% index 53df40900b..8296749167 100644 --- a/sys/platform/pc64/acpica/acpi_machdep.c +++ b/sys/platform/pc64/acpica/acpi_machdep.c @@ -1,351 +1,79 @@ -/*- - * Copyright (c) 2001 Mitsuru IWASAKI - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.20 2004/05/05 19:51:15 njl Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "acpi.h" -#include -#include - -static device_t acpi_dev; - -/* - * APM driver emulation - */ - -#include - -#include -#include -#include -#include - -uint32_t acpi_reset_video = 1; -TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); - -static int apm_active; - -static d_open_t apmopen; -static d_close_t apmclose; -static d_write_t apmwrite; -static d_ioctl_t apmioctl; -static d_kqfilter_t apmkqfilter; - -static struct dev_ops apm_ops = { - { "apm", 0, 0 }, - .d_open = apmopen, - .d_close = apmclose, - .d_write = apmwrite, - .d_ioctl = apmioctl, - .d_kqfilter = apmkqfilter -}; - -static int -acpi_capm_convert_battstate(struct acpi_battinfo *battp) -{ - int state; - - state = 0xff; /* XXX unknown */ - - if (battp->state & ACPI_BATT_STAT_DISCHARG) { - if (battp->cap >= 50) - state = 0; /* high */ - else - state = 1; /* low */ - } - if (battp->state & ACPI_BATT_STAT_CRITICAL) - state = 2; /* critical */ - if (battp->state & ACPI_BATT_STAT_CHARGING) - state = 3; /* charging */ - - /* If still unknown, determine it based on the battery capacity. */ - if (state == 0xff) { - if (battp->cap >= 50) - state = 0; /* high */ - else - state = 1; /* low */ - } - - return (state); -} - -static int -acpi_capm_convert_battflags(struct acpi_battinfo *battp) -{ - int flags; - - flags = 0; - - if (battp->cap >= 50) - flags |= APM_BATT_HIGH; - else { - if (battp->state & ACPI_BATT_STAT_CRITICAL) - flags |= APM_BATT_CRITICAL; - else - flags |= APM_BATT_LOW; - } - if (battp->state & ACPI_BATT_STAT_CHARGING) - flags |= APM_BATT_CHARGING; - if (battp->state == ACPI_BATT_STAT_NOT_PRESENT) - flags = APM_BATT_NOT_PRESENT; - - return (flags); -} - -static int -acpi_capm_get_info(apm_info_t aip) -{ - int acline; - struct acpi_battinfo batt; - - aip->ai_infoversion = 1; - aip->ai_major = 1; - aip->ai_minor = 2; - aip->ai_status = apm_active; - aip->ai_capabilities= 0xff00; /* XXX unknown */ - - if (acpi_acad_get_acline(&acline)) - aip->ai_acline = 0xff; /* unknown */ - else - aip->ai_acline = acline; /* on/off */ - - if (acpi_battery_get_battinfo(NULL, &batt)) { - aip->ai_batt_stat = 0xff; /* unknown */ - aip->ai_batt_life = 0xff; /* unknown */ - aip->ai_batt_time = -1; /* unknown */ - aip->ai_batteries = 0; - } else { - aip->ai_batt_stat = acpi_capm_convert_battstate(&batt); - aip->ai_batt_life = batt.cap; - aip->ai_batt_time = (batt.min == -1) ? -1 : batt.min * 60; - aip->ai_batteries = acpi_battery_get_units(); - } - - return (0); -} - -static int -acpi_capm_get_pwstatus(apm_pwstatus_t app) -{ - device_t dev; - int acline, unit, error; - struct acpi_battinfo batt; - - if (app->ap_device != PMDV_ALLDEV && - (app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL)) - return (1); - - if (app->ap_device == PMDV_ALLDEV) - error = acpi_battery_get_battinfo(NULL, &batt); - else { - unit = app->ap_device - PMDV_BATT0; - dev = devclass_get_device(devclass_find("battery"), unit); - if (dev != NULL) - error = acpi_battery_get_battinfo(dev, &batt); - else - error = ENXIO; - } - if (error) - return (1); - - app->ap_batt_stat = acpi_capm_convert_battstate(&batt); - app->ap_batt_flag = acpi_capm_convert_battflags(&batt); - app->ap_batt_life = batt.cap; - app->ap_batt_time = (batt.min == -1) ? -1 : batt.min * 60; - - if (acpi_acad_get_acline(&acline)) - app->ap_acline = 0xff; /* unknown */ - else - app->ap_acline = acline; /* on/off */ - - return (0); -} - -static int -apmopen(struct dev_open_args *ap) -{ - return (0); -} - -static int -apmclose(struct dev_close_args *ap) -{ - return (0); -} - -static int -apmioctl(struct dev_ioctl_args *ap) -{ - int error = 0; - struct acpi_softc *acpi_sc; - struct apm_info info; - apm_info_old_t aiop; - - acpi_sc = device_get_softc(acpi_dev); - - switch (ap->a_cmd) { - case APMIO_SUSPEND: - if ((ap->a_fflag & FWRITE) == 0) - return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_suspend_sx); - else - error = EINVAL; - break; - case APMIO_STANDBY: - if ((ap->a_fflag & FWRITE) == 0) - return (EPERM); - if (apm_active) - acpi_SetSleepState(acpi_sc, acpi_sc->acpi_standby_sx); - else - error = EINVAL; - break; - case APMIO_GETINFO_OLD: - if (acpi_capm_get_info(&info)) - error = ENXIO; - aiop = (apm_info_old_t)ap->a_data; - aiop->ai_major = info.ai_major; - aiop->ai_minor = info.ai_minor; - aiop->ai_acline = info.ai_acline; - aiop->ai_batt_stat = info.ai_batt_stat; - aiop->ai_batt_life = info.ai_batt_life; - aiop->ai_status = info.ai_status; - break; - case APMIO_GETINFO: - if (acpi_capm_get_info((apm_info_t)ap->a_data)) - error = ENXIO; - break; - case APMIO_GETPWSTATUS: - if (acpi_capm_get_pwstatus((apm_pwstatus_t)ap->a_data)) - error = ENXIO; - break; - case APMIO_ENABLE: - if ((ap->a_fflag & FWRITE) == 0) - return (EPERM); - apm_active = 1; - break; - case APMIO_DISABLE: - if ((ap->a_fflag & FWRITE) == 0) - return (EPERM); - apm_active = 0; - break; - case APMIO_HALTCPU: - break; - case APMIO_NOTHALTCPU: - break; - case APMIO_DISPLAY: - if ((ap->a_fflag & FWRITE) == 0) - return (EPERM); - break; - case APMIO_BIOS: - if ((ap->a_fflag & FWRITE) == 0) - return (EPERM); - bzero(ap->a_data, sizeof(struct apm_bios_arg)); - break; - default: - error = EINVAL; - break; - } - - return (error); -} - -static int -apmwrite(struct dev_write_args *ap) -{ - return (ap->a_uio->uio_resid); -} - -static void apmfilter_detach(struct knote *); -static int apmfilter(struct knote *, long); - -static struct filterops apmfilterops = - { FILTEROP_ISFD, NULL, apmfilter_detach, apmfilter }; - -static int -apmkqfilter(struct dev_kqfilter_args *ap) -{ - struct knote *kn = ap->a_kn; - - kn->kn_fop = &apmfilterops; - ap->a_result = 0; - return (0); -} - -static void -apmfilter_detach(struct knote *kn) {} - -static int -apmfilter(struct knote *kn, long hint) -{ - return (0); -} - -static void -acpi_capm_init(struct acpi_softc *sc) -{ - make_dev(&apm_ops, 0, 0, 5, 0664, "apm"); - make_dev(&apm_ops, 8, 0, 5, 0664, "apm"); -} - -int -acpi_machdep_init(device_t dev) -{ - struct acpi_softc *sc; - - acpi_dev = dev; - sc = device_get_softc(acpi_dev); - - acpi_capm_init(sc); - - acpi_install_wakeup_handler(sc); - - if (ioapic_enable) - acpi_SetIntrModel(ACPI_INTR_APIC); - - SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, - SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, - "reset_video", CTLFLAG_RD | CTLFLAG_RW, &acpi_reset_video, 0, - "Call the VESA reset BIOS vector on the resume path"); - - return (0); -} - -int -acpi_machdep_quirks(int *quirks) -{ - return (0); -} - +/*- + * Copyright (c) 2001 Mitsuru IWASAKI + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.20 2004/05/05 19:51:15 njl Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "acpi.h" +#include +#include + +static device_t acpi_dev; + +#include + +#include +#include +#include + +uint32_t acpi_reset_video = 1; +TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video); + +int +acpi_machdep_init(device_t dev) +{ + struct acpi_softc *sc; + + acpi_dev = dev; + sc = device_get_softc(acpi_dev); + + acpi_install_wakeup_handler(sc); + + if (ioapic_enable) + acpi_SetIntrModel(ACPI_INTR_APIC); + + SYSCTL_ADD_UINT(&sc->acpi_sysctl_ctx, + SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, + "reset_video", CTLFLAG_RD | CTLFLAG_RW, &acpi_reset_video, 0, + "Call the VESA reset BIOS vector on the resume path"); + + return (0); +} + +int +acpi_machdep_quirks(int *quirks) +{ + return (0); +} + diff --git a/sys/platform/pc64/include/apm_bios.h b/sys/platform/pc64/include/apm_bios.h deleted file mode 100644 index a436ad7a67..0000000000 --- a/sys/platform/pc64/include/apm_bios.h +++ /dev/null @@ -1,267 +0,0 @@ -/* - * APM (Advanced Power Management) BIOS Device Driver - * - * Copyright (c) 1994-1995 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. - * - * Aug, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) - * - * $FreeBSD: src/sys/i386/include/apm_bios.h,v 1.27.2.2 2002/04/12 16:47:00 bmah Exp $ - * $DragonFly: src/sys/platform/pc32/include/apm_bios.h,v 1.5 2006/05/20 02:42:06 dillon Exp $ - */ - -#ifndef _MACHINE_APM_BIOS_H_ -#define _MACHINE_APM_BIOS_H_ - -#ifndef _SYS_TYPES_H_ -#include -#endif -#ifndef _SYS_IOCCOM_H_ -#include -#endif - -/* BIOS id */ -#define APM_BIOS 0x53 -#define APM_INT 0x15 - -/* APM flags */ -#define APM_16BIT_SUPPORT 0x01 -#define APM_32BIT_SUPPORT 0x02 -#define APM_CPUIDLE_SLOW 0x04 -#define APM_DISABLED 0x08 -#define APM_DISENGAGED 0x10 - -/* APM initializer physical address */ -#define APM_OURADDR 0x00080000 - -/* APM functions */ -#define APM_INSTCHECK 0x00 -#define APM_REALCONNECT 0x01 -#define APM_PROT16CONNECT 0x02 -#define APM_PROT32CONNECT 0x03 -#define APM_DISCONNECT 0x04 -#define APM_CPUIDLE 0x05 -#define APM_CPUBUSY 0x06 -#define APM_SETPWSTATE 0x07 -#define APM_ENABLEDISABLEPM 0x08 -#define APM_RESTOREDEFAULT 0x09 -#define APM_GETPWSTATUS 0x0a -#define APM_GETPMEVENT 0x0b -#define APM_GETPWSTATE 0x0c -#define APM_ENABLEDISABLEDPM 0x0d -#define APM_DRVVERSION 0x0e -#define APM_ENGAGEDISENGAGEPM 0x0f -#define APM_GETCAPABILITIES 0x10 -#define APM_RESUMETIMER 0x11 -#define APM_RESUMEONRING 0x12 -#define APM_TIMERREQUESTS 0x13 -#define APM_OEMFUNC 0x80 - -/* error code */ -#define APME_OK 0x00 -#define APME_PMDISABLED 0x01 -#define APME_REALESTABLISHED 0x02 -#define APME_NOTCONNECTED 0x03 -#define APME_PROT16ESTABLISHED 0x05 -#define APME_PROT16NOTSUPPORTED 0x06 -#define APME_PROT32ESTABLISHED 0x07 -#define APME_PROT32NOTDUPPORTED 0x08 -#define APME_UNKNOWNDEVICEID 0x09 -#define APME_OUTOFRANGE 0x0a -#define APME_NOTENGAGED 0x0b -#define APME_CANTENTERSTATE 0x60 -#define APME_NOPMEVENT 0x80 -#define APME_NOAPMPRESENT 0x86 - - -/* device code */ -#define PMDV_APMBIOS 0x0000 -#define PMDV_ALLDEV 0x0001 -#define PMDV_DISP0 0x0100 -#define PMDV_DISP1 0x0101 -#define PMDV_DISPALL 0x01ff -#define PMDV_2NDSTORAGE0 0x0200 -#define PMDV_2NDSTORAGE1 0x0201 -#define PMDV_2NDSTORAGE2 0x0202 -#define PMDV_2NDSTORAGE3 0x0203 -#define PMDV_PARALLEL0 0x0300 -#define PMDV_PARALLEL1 0x0301 -#define PMDV_SERIAL0 0x0400 -#define PMDV_SERIAL1 0x0401 -#define PMDV_SERIAL2 0x0402 -#define PMDV_SERIAL3 0x0403 -#define PMDV_SERIAL4 0x0404 -#define PMDV_SERIAL5 0x0405 -#define PMDV_SERIAL6 0x0406 -#define PMDV_SERIAL7 0x0407 -#define PMDV_NET0 0x0500 -#define PMDV_NET1 0x0501 -#define PMDV_NET2 0x0502 -#define PMDV_NET3 0x0503 -#define PMDV_PCMCIA0 0x0600 -#define PMDV_PCMCIA1 0x0601 -#define PMDV_PCMCIA2 0x0602 -#define PMDV_PCMCIA3 0x0603 -/* 0x0700 - 0x7fff Reserved */ -#define PMDV_BATT_BASE 0x8000 -#define PMDV_BATT0 0x8001 -#define PMDV_BATT1 0x8002 -#define PMDV_BATT_ALL 0x80ff -/* 0x8100 - 0xdfff Reserved */ -/* 0xe000 - 0xefff OEM-defined power device IDs */ -/* 0xf000 - 0xffff Reserved */ - -/* Power state */ -#define PMST_APMENABLED 0x0000 -#define PMST_STANDBY 0x0001 -#define PMST_SUSPEND 0x0002 -#define PMST_OFF 0x0003 -#define PMST_LASTREQNOTIFY 0x0004 -#define PMST_LASTREQREJECT 0x0005 -/* 0x0006 - 0x001f Reserved system states */ -/* 0x0020 - 0x003f OEM-defined system states */ -/* 0x0040 - 0x007f OEM-defined device states */ -/* 0x0080 - 0xffff Reserved device states */ - -#if !defined(ASSEMBLER) && !defined(INITIALIZER) - -/* C definitions */ -struct apmhook { - struct apmhook *ah_next; - int (*ah_fun) (void *ah_arg); - void *ah_arg; - const char *ah_name; - int ah_order; -}; -#define APM_HOOK_NONE (-1) -#define APM_HOOK_SUSPEND 0 -#define APM_HOOK_RESUME 1 -#define NAPM_HOOK 2 - -#ifdef _KERNEL - -void apm_suspend(int state); -struct apmhook *apm_hook_establish (int apmh, struct apmhook *); -void apm_hook_disestablish (int apmh, struct apmhook *); -void apm_cpu_idle(void); -void apm_cpu_busy(void); - -#endif - -#endif /* !ASSEMBLER && !INITIALIZER */ - -#define APM_MIN_ORDER 0x00 -#define APM_MID_ORDER 0x80 -#define APM_MAX_ORDER 0xff - -/* power management event code */ -#define PMEV_NOEVENT 0x0000 -#define PMEV_STANDBYREQ 0x0001 -#define PMEV_SUSPENDREQ 0x0002 -#define PMEV_NORMRESUME 0x0003 -#define PMEV_CRITRESUME 0x0004 -#define PMEV_BATTERYLOW 0x0005 -#define PMEV_POWERSTATECHANGE 0x0006 -#define PMEV_UPDATETIME 0x0007 -#define PMEV_CRITSUSPEND 0x0008 -#define PMEV_USERSTANDBYREQ 0x0009 -#define PMEV_USERSUSPENDREQ 0x000a -#define PMEV_STANDBYRESUME 0x000b -#define PMEV_CAPABILITIESCHANGE 0x000c -/* 0x000d - 0x00ff Reserved system events */ -/* 0x0100 - 0x01ff Reserved device events */ -/* 0x0200 - 0x02ff OEM-defined APM events */ -/* 0x0300 - 0xffff Reserved */ -#define PMEV_DEFAULT 0xffffffff /* used for customization */ - -#if !defined(ASSEMBLER) && !defined(INITIALIZER) - -/* - * Old apm_info structure, returned by the APMIO_GETINFO_OLD ioctl. This - * is for backward compatibility with old executables. - */ -typedef struct apm_info_old { - u_int ai_major; /* APM major version */ - u_int ai_minor; /* APM minor version */ - u_int ai_acline; /* AC line status */ - u_int ai_batt_stat; /* Battery status */ - u_int ai_batt_life; /* Remaining battery life */ - u_int ai_status; /* Status of APM support (enabled/disabled) */ -} *apm_info_old_t; - -/* - * Structure returned by the APMIO_GETINFO ioctl. - * - * In the comments below, the parenthesized numbers indicate the minimum - * value of ai_infoversion for which each field is valid. - */ -typedef struct apm_info { - u_int ai_infoversion; /* Indicates which fields are valid */ - u_int ai_major; /* APM major version (0) */ - u_int ai_minor; /* APM minor version (0) */ - u_int ai_acline; /* AC line status (0) */ - u_int ai_batt_stat; /* Battery status (0) */ - u_int ai_batt_life; /* Remaining battery life in percent (0) */ - int ai_batt_time; /* Remaining battery time in seconds (0) */ - u_int ai_status; /* True if enabled (0) */ - u_int ai_batteries; /* Number of batteries (1) */ - u_int ai_capabilities;/* APM Capabilities (1) */ - u_int ai_spare[6]; /* For future expansion */ -} *apm_info_t; - -/* Battery flag */ -#define APM_BATT_HIGH 0x01 -#define APM_BATT_LOW 0x02 -#define APM_BATT_CRITICAL 0x04 -#define APM_BATT_CHARGING 0x08 -#define APM_BATT_NOT_PRESENT 0x10 -#define APM_BATT_NO_SYSTEM 0x80 - -typedef struct apm_pwstatus { - u_int ap_device; /* Device code of battery */ - u_int ap_acline; /* AC line status (0) */ - u_int ap_batt_stat; /* Battery status (0) */ - u_int ap_batt_flag; /* Battery flag (0) */ - u_int ap_batt_life; /* Remaining battery life in percent (0) */ - int ap_batt_time; /* Remaining battery time in seconds (0) */ -} *apm_pwstatus_t; - -struct apm_bios_arg { - u_long eax; - u_long ebx; - u_long ecx; - u_long edx; - u_long esi; - u_long edi; -}; - -struct apm_event_info { - u_int type; - u_int index; - u_int spare[8]; -}; - -#define APMIO_SUSPEND _IO('P', 1) -#define APMIO_GETINFO_OLD _IOR('P', 2, struct apm_info_old) -#define APMIO_ENABLE _IO('P', 5) -#define APMIO_DISABLE _IO('P', 6) -#define APMIO_HALTCPU _IO('P', 7) -#define APMIO_NOTHALTCPU _IO('P', 8) -#define APMIO_DISPLAY _IOW('P', 9, int) -#define APMIO_BIOS _IOWR('P', 10, struct apm_bios_arg) -#define APMIO_GETINFO _IOR('P', 11, struct apm_info) -#define APMIO_STANDBY _IO('P', 12) -#define APMIO_GETPWSTATUS _IOWR('P', 13, struct apm_pwstatus) -/* for /dev/apmctl */ -#define APMIO_NEXTEVENT _IOR('A', 100, struct apm_event_info) -#define APMIO_REJECTLASTREQ _IO('P', 101) - -#endif /* !ASSEMBLER && !INITIALIZER */ - -#endif /* !_MACHINE_APM_BIOS_H_ */ diff --git a/sys/sys/kbio.h b/sys/sys/kbio.h index 5e956039da..db7240ec00 100644 --- a/sys/sys/kbio.h +++ b/sys/sys/kbio.h @@ -160,7 +160,7 @@ typedef struct okeymap okeymap_t; #define META 0x84 /* meta key */ #define RBT 0x85 /* boot machine */ #define DBG 0x86 /* call debugger */ -#define SUSP 0x87 /* suspend power (APM) */ +#define SUSP 0x87 /* suspend power */ #define SPSC 0x88 /* toggle splash/text screen */ #define F_ACC DGRA /* first accent key */ @@ -182,7 +182,7 @@ typedef struct okeymap okeymap_t; #define DCAR 0x97 /* caron */ #define L_ACC DCAR /* last accent key */ -#define STBY 0x98 /* Go into standby mode (apm) */ +#define STBY 0x98 /* Go into standby mode */ #define PREV 0x99 /* switch to previous screen */ #define PNC 0x9a /* force system panic */ #define LSHA 0x9b /* left shift key / alt lock */ diff --git a/sys/sys/param.h b/sys/sys/param.h index e8f1f855a5..f69c71a2c3 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -168,9 +168,10 @@ * 500104 - cfmakesane() * 500105 - _SC_LEVEL1_DCACHE_LINESIZE sysconf() * 500106 - %b and %r formats removal + * 500107 - removal */ #undef __DragonFly_version -#define __DragonFly_version 500106 /* propagated to newvers */ +#define __DragonFly_version 500107 /* propagated to newvers */ #include diff --git a/usr.sbin/kbdcontrol/kbdmap.5 b/usr.sbin/kbdcontrol/kbdmap.5 index 179fc78788..bec27993a9 100644 --- a/usr.sbin/kbdcontrol/kbdmap.5 +++ b/usr.sbin/kbdcontrol/kbdmap.5 @@ -23,9 +23,8 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/usr.sbin/kbdcontrol/kbdmap.5,v 1.1.2.4 2001/08/01 12:01:28 sheldonh Exp $ -.\" $DragonFly: src/usr.sbin/kbdcontrol/kbdmap.5,v 1.2 2003/06/17 04:29:55 dillon Exp $ .\" -.Dd September 11, 2000 +.Dd February 22, 2018 .Dt KBDMAP 5 .Os .Sh NAME @@ -225,7 +224,7 @@ and attempt to power it down. .It debug Call the debugger. .It susp -Use APM to suspend power. +Suspend power (unsupported). .It saver Activate screen saver by toggling between splash/text screen. -- 2.11.4.GIT