Home | History | Annotate | Line # | Download | only in apm
      1  1.7       dsl /*	$NetBSD: apmbios.h,v 1.7 2012/09/30 21:36:20 dsl Exp $	*/
      2  1.1  takemura /*-
      3  1.1  takemura  * Copyright (c) 1995 The NetBSD Foundation, Inc.
      4  1.1  takemura  * All rights reserved.
      5  1.1  takemura  *
      6  1.1  takemura  * This code is derived from software contributed to The NetBSD Foundation
      7  1.1  takemura  * by John Kohl.
      8  1.1  takemura  *
      9  1.1  takemura  * Redistribution and use in source and binary forms, with or without
     10  1.1  takemura  * modification, are permitted provided that the following conditions
     11  1.1  takemura  * are met:
     12  1.1  takemura  * 1. Redistributions of source code must retain the above copyright
     13  1.1  takemura  *    notice, this list of conditions and the following disclaimer.
     14  1.1  takemura  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  takemura  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  takemura  *    documentation and/or other materials provided with the distribution.
     17  1.1  takemura  *
     18  1.1  takemura  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     19  1.1  takemura  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     20  1.1  takemura  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     21  1.1  takemura  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     22  1.1  takemura  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     23  1.1  takemura  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     24  1.1  takemura  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25  1.1  takemura  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     26  1.1  takemura  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     27  1.1  takemura  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     28  1.1  takemura  * POSSIBILITY OF SUCH DAMAGE.
     29  1.1  takemura  */
     30  1.4  christos #ifndef _DEV_APM_APMBIOS_H_
     31  1.4  christos #define _DEV_APM_APMBIOS_H_
     32  1.1  takemura 
     33  1.1  takemura /*
     34  1.6       dsl  * These definitions were those for the i386 'APM' (which predates ACPI),
     35  1.6       dsl  * but have been hijacked for all sorts of uses.
     36  1.6       dsl  * The APM specific values were removed when APM was removed.
     37  1.1  takemura  */
     38  1.1  takemura 
     39  1.1  takemura #define	APM_ERR_PM_DISABLED	0x01
     40  1.1  takemura #define	APM_ERR_REALALREADY	0x02
     41  1.1  takemura #define	APM_ERR_NOTCONN		0x03
     42  1.1  takemura #define	APM_ERR_16ALREADY	0x05
     43  1.1  takemura #define	APM_ERR_16NOTSUPP	0x06
     44  1.1  takemura #define	APM_ERR_32ALREADY	0x07
     45  1.1  takemura #define	APM_ERR_32NOTSUPP	0x08
     46  1.1  takemura #define	APM_ERR_UNRECOG_DEV	0x09
     47  1.1  takemura #define	APM_ERR_ERANGE		0x0A
     48  1.1  takemura #define	APM_ERR_NOTENGAGED	0x0B
     49  1.1  takemura #define	APM_ERR_EOPNOTSUPP	0x0C
     50  1.1  takemura #define	APM_ERR_RTIMER_DISABLED	0x0D
     51  1.1  takemura #define APM_ERR_UNABLE		0x60
     52  1.1  takemura #define APM_ERR_NOEVENTS	0x80
     53  1.1  takemura #define	APM_ERR_NOT_PRESENT	0x86
     54  1.1  takemura 
     55  1.1  takemura #define APM_DEV_ALLDEVS		0x0001
     56  1.6       dsl 
     57  1.6       dsl #define		APM_SYS_READY	0x0000
     58  1.1  takemura #define		APM_SYS_STANDBY	0x0001
     59  1.1  takemura #define		APM_SYS_SUSPEND	0x0002
     60  1.1  takemura #define		APM_SYS_OFF	0x0003
     61  1.1  takemura #define		APM_LASTREQ_INPROG	0x0004
     62  1.1  takemura #define		APM_LASTREQ_REJECTED	0x0005
     63  1.1  takemura 
     64  1.1  takemura #define		APM_AC_OFF		0x00
     65  1.1  takemura #define		APM_AC_ON		0x01
     66  1.1  takemura #define		APM_AC_BACKUP		0x02
     67  1.1  takemura #define		APM_AC_UNKNOWN		0xff
     68  1.6       dsl 
     69  1.1  takemura /* the first set of battery constants is 1.0 style values;
     70  1.6       dsl  * the second set is 1.1 style bit definitions */
     71  1.1  takemura #define		APM_BATT_HIGH		0x00
     72  1.1  takemura #define		APM_BATT_LOW		0x01
     73  1.1  takemura #define		APM_BATT_CRITICAL	0x02
     74  1.1  takemura #define		APM_BATT_CHARGING	0x03
     75  1.1  takemura #define		APM_BATT_ABSENT		0x04 /* Software only--not in spec! */
     76  1.1  takemura #define		APM_BATT_UNKNOWN	0xff
     77  1.1  takemura 
     78  1.1  takemura #define		APM_BATT_FLAG_HIGH	0x01
     79  1.1  takemura #define		APM_BATT_FLAG_LOW	0x02
     80  1.1  takemura #define		APM_BATT_FLAG_CRITICAL	0x04
     81  1.1  takemura #define		APM_BATT_FLAG_CHARGING	0x08
     82  1.1  takemura #define		APM_BATT_FLAG_NOBATTERY	0x10
     83  1.1  takemura #define		APM_BATT_FLAG_NO_SYSTEM_BATTERY	0x80
     84  1.1  takemura #define		APM_BATT_FLAG_UNKNOWN	0xff
     85  1.1  takemura 
     86  1.1  takemura #define		APM_BATT_LIFE_UNKNOWN	0xff
     87  1.1  takemura 
     88  1.1  takemura #define		APM_STANDBY_REQ		0x0001 /* %bx on return */
     89  1.1  takemura #define		APM_SUSPEND_REQ		0x0002
     90  1.1  takemura #define		APM_NORMAL_RESUME	0x0003
     91  1.1  takemura #define		APM_CRIT_RESUME		0x0004 /* suspend/resume happened
     92  1.1  takemura 						  without us */
     93  1.1  takemura #define		APM_BATTERY_LOW		0x0005
     94  1.1  takemura #define		APM_POWER_CHANGE	0x0006
     95  1.1  takemura #define		APM_UPDATE_TIME		0x0007
     96  1.1  takemura #define		APM_CRIT_SUSPEND_REQ	0x0008
     97  1.1  takemura #define		APM_USER_STANDBY_REQ	0x0009
     98  1.1  takemura #define		APM_USER_SUSPEND_REQ	0x000A
     99  1.1  takemura #define		APM_SYS_STANDBY_RESUME	0x000B
    100  1.1  takemura #define		APM_CAP_CHANGE		0x000C	/* V1.2 */
    101  1.1  takemura 
    102  1.1  takemura #define		APM_GLOBAL_STANDBY	0x0001
    103  1.1  takemura #define		APM_GLOBAL_SUSPEND	0x0002
    104  1.1  takemura 
    105  1.1  takemura /*
    106  1.1  takemura  * APM info word from the real-mode handler is adjusted to put
    107  1.1  takemura  * major/minor version in low half and support bits in upper half.
    108  1.1  takemura  */
    109  1.1  takemura #define	APM_MAJOR_VERS(info) (((info)&0xff00)>>8)
    110  1.1  takemura #define	APM_MINOR_VERS(info) ((info)&0xff)
    111  1.1  takemura 
    112  1.4  christos #define	APMDEBUG_INFO		0x01
    113  1.4  christos #define	APMDEBUG_EVENTS		0x04
    114  1.4  christos #define	APMDEBUG_DEVICE		0x20
    115  1.4  christos #define	APMDEBUG_ANOM		0x40
    116  1.4  christos 
    117  1.4  christos #endif /* _DEV_APM_APMBIOS_H_ */
    118