;**************************************************************
;*  APMEQU.INC - Include file for APM
;*
;*  IBM Confidential
;*  Copyright (C) IBM Corporation 1992
;*  All Rights Reserved.
;*
;*  Revision History:
;*  ----------------
;*  08/1/91  NSM        Created
;*
;*  03/22/94 kam001 -  Changed device IDs of serial ports to 0004
;*                     and parallel ports to 0003
;*                  -  Added equates for APM 1.1 version number
;*  03/26/94 kam002 -  Added equates for the following PM Events
;*                     defined in APM 1.1 BIOS Specification
;*                     Power Status Change Notification, Update
;*                     Time Notification, Critical System Suspend
;*                     Notification, User System Standby Request
;*                     Notification, User System Suspend Request
;*                     Notification, System Standby Resume Notification
;*                  -  Added equates for Suspend Power State, Last Request
;*                     Processing Notification and Last Request Rejected
;*                     Notification
;*  04/04/94 kam003 -  Added equates for Get Power Status, Get
;*                     Power State, Enable/Disable device Power
;*                     Management, APM Driver_Version and Engage/
;*                     Disengage Power Management, INT 15h calls
;*                     defined in APM BIOS 1.1 Specification,
;*                     September 1993
;*  05/17/94 kam011 -  Added equate for STANDBY. DEFECT # 7488
;*  05/20/94 kam016 -  Changed the system event SUSPEND_OK defined for two
;*                     phase protocol from 000Ch to E000h. Comments from
;*                     Japan included below.
;*                     We think this definition may prevent the future
;*                     extension of APM; if APM rev 1.2 or latter defines
;*                     some system event as '000C', the modification of
;*                     APM aware driver which support the two phase
;*                     protocol may be difficult. DEFECT # 7587
;*  06/06/94 kam017 -  APM_SUSPEND_OK PM event redefined to 0E000h
;*  07/26/94 kam025 -  DEFECT 9085 - Suspend not working correctly
;                      (more comments from Japan)
;                      Removed APM_SUSPEND_OK event and defined a new
;                      INT 2Fh API (530C) - Get PM Event First Phase Broadcast
;                      in power.asm module.
; 09/02/94  kam027  -  DEFECT 10185 - Version Number returned is incorrect.
;**************************************************************
;
;*************************************************************
; APM function codes
;*************************************************************
;
APM_INSTALLCHK_FUNC     equ     5300h
;
APM_CONNECT_FUNC        equ     5301h   ; real mode connect
APM_DISCONNECT_FUNC     equ     5304h
;
APM_CPUIDLE_FUNC        equ     5305h
APM_CPUBUSY_FUNC        equ     5306h
APM_SETPWSTATE_FUNC     equ     5307h   ; set power state
APM_ENABLE_DISABLE_FUNC equ     5308h
APM_REST_DEFLT_FUNC     equ     5309h   ; restore power-on defaults
APM_GETPWSTATUS_FUNC    equ     530ah   ; Get Power Status   kam003
APM_GETPMEVENT_FUNC     equ     530bh
APM_GETPWSTATE_FUNC     equ     530ch   ; Get Power State    kam003
APM_ENABLE_DISABLE_DEV_PM  equ  530dh   ;                    kam003
APM_DRIVER_VERSION      equ     530eh   ; APM Driver Version kam003
APM_ENGAGE_DISENGAGE_PM equ     530fh   ;                    kam003


;*************************************************************
; values for APM device ids
;*************************************************************
;
; SYSTEM class
APM_SYSTEM_BIOS equ     0000h
APM_SYSTEM_DEV  equ     0001h
APM_SYSTEM_CPU  equ     0002h
;display class
APM_DISPLAY_ALL equ     0100h
; parallel ports
APM_PARALLEL_ALL equ    0300h           ; kam001
; SERIAL ports
APM_SERIAL_ALL  equ     0400h           ; kam001
;
; global ID ; set containing all power managed devices
APM_ALL_DEVICES equ     0ffffh
;
;*************************************************************
; sub-function codes for some of the above functions
;*************************************************************

; values for ENABLE_DISABLE_FUNC
APM_ENABLE_FUNC   equ     1
APM_DISABLE_FUNC  equ     0

;*************************************************************

; return values of some APM functions:

;*************************************************************

APM_SIGNATURE   equ     "PM"            ; M003: APM signature is:
                                        ; BH = 'P' and BL = 'M'
;
; PM events
;
APM_STANDBY_REQ                 equ     01
APM_SUSPEND_REQ                 equ     02
APM_NORM_RESUME                 equ     03
APM_CRIT_RESUME                 equ     04
APM_BATT_LOW                    equ     05
;
;=========================================================================
; The following power management events are defined for APM 1.1 connection
; when a PM event occurs.
APM_POWER_STATUS_CHANGE         equ     06h     ; kam002
APM_UPDATE_TIME                 equ     07h     ; kam002
APM_CRITICAL_SYSTEM_SUSPEND     equ     08h     ; kam002
APM_USER_SYSTEM_STANDBY_REQ     equ     09h     ; kam002
APM_USER_SYSTEM_SUSPEND_REQ     equ     0Ah     ; kam002
APM_SYSTEM_STANDBY_RESUME       equ     0Bh     ; kam002

;=========================================================================
; APM_FLAGS masks (returned by APM detect call)
APM_SLOW_CLOCK  equ     0100B   ; bit 2  = 1 if CPU_IDLE slows processor clock
APM_PWMGMT_DISABLED     equ     1000b   ; bit3 = 1 if power mgmt. disabled

;*************************************************************

APM11_VER_MAJOR    equ   1       ; APM version major            kam001
APM11_VER_MINOR    equ   1       ; APM version minor            kam001
POWER_VER_MAJOR equ     1        ; POWER.EXE major version      kam027
POWER_VER_MINOR equ     1        ; POWER.EXE minor version      kam027
                                 ; The version is interpreted as 1.01
                                 ; in BCD format.

STANDBY            equ   0001    ;                                      kam011
SUSPEND            equ   0002    ; Suspend Power State                  kam002
LAST_REQ_PROC      equ   0004    ; Last Request Processing Notification kam002
LAST_REQ_REJECT    equ   0005    ; Last Request Rejected                kam002

;*************************************************************

DEVICEID_BITS   equ     11111000b ; least 3 bits are currently allowed  kam002

;*************************************************************

PM_EVENT_FIRST_PHASE_BROADCAST  equ     530Ch           ; kam025
