sys7.1-doc-wip/Interfaces/AIncludes/PowerMgrDispatchEqu.a
2019-07-27 22:37:48 +08:00

340 lines
7.2 KiB
Plaintext

;
; File: PowerMgrDispatchEqu.a
;
; Contains: equates for routines that access the Power Manager
;
; Written by: Steve Christensen
;
; Copyright: © 1992-1993 by Apple Computer, Inc. All rights reserved.
;
; This file is used in these builds: ROM
;
; Change History (most recent first):
;
; <SM2> 12/13/93 PN Roll in KAOs and Horror changes to support Malcom and AJ
; machines
; <1> 9/2/93 KH first checked in
; <SM1> 9/2/93 SKH Rolled in from Horror
;
; <H6> 6/21/93 SWC Cleaned up the modem info and wakeup timer stuff.
; <H5> 6/16/93 SWC Added the SetWakeupOnRing selector.
; <H4> 6/16/93 SWC Added a "can wakeup on ring" bit to the public features.
; <H3> 5/28/93 SWC Fixed a couple of bugs in the macros.
; <H2> 5/28/93 SWC Added some more selectors so they'll be in for the next Escher
; beta build.
; <H1> 5/3/93 SWC Adding the file to Horror.
;
_PowerMgrDispatch OPWORD $A09E
; selectors off of the PowerMgrDispatch trap
PwrMgrCountDisp EQU 0
PMFeaturesDisp EQU 1
GetSleepTODisp EQU 2
SetSleepTODisp EQU 3
GetHDTODisp EQU 4
SetHDTODisp EQU 5
HDPoweredDisp EQU 6
HDOffDisp EQU 7
IsHDDisableDisp EQU 8
HDDisableDisp EQU 9
HDQInstallDisp EQU 10
HDQRemoveDisp EQU 11
GetScaleBattDisp EQU 12
AutoSlpControlDisp EQU 13
SelectIntModemDisp EQU 14
ModemInfoDisp EQU 15
MaxSpeedDisp EQU 16
CurrentSpeedDisp EQU 17
FullSpeedDisp EQU 18
SetSpeedDisp EQU 19
GetDiskModeDisp EQU 20
SetDiskModeDisp EQU 21
GetWakeupDisp EQU 22
SetWakeupDisp EQU 23
GetCPUCycleDisp EQU 24
SetCPUCycleDisp EQU 25
BatteryCountDisp EQU 26
AbsoluteBatteryDisp EQU 27
BatteryTimeDisp EQU 28
GetDimmingTimeout EQU 29
SetDimmingTimeout EQU 30
DimmingControl EQU 31
; definition of bits in bitfield returned by PMFeatures
hasWakeupTimer EQU 0 ; 1=wakeup timer is supported
hasSharedModemPort EQU 1 ; 1=modem port shared by SCC and internal modem
hasProcessorCycling EQU 2 ; 1=processor cycling is supported
mustProcessorCycle EQU 3 ; 1=processor cycling should not be turned off
hasReducedSpeed EQU 4 ; 1=processor can be started up at reduced speed
dynamicSpeedChange EQU 5 ; 1=processor speed can be switched dynamically
hasSCSIDiskMode EQU 6 ; 1=SCSI Disk Mode is supported
canGetBatteryTime EQU 7 ; 1=battery time can be calculated
canWakeupOnRing EQU 8 ; 1=can wakeup when the modem detects a ring
; definition of bits in bitfield returned by GetIntModemInfo and set in SetIntModemState
hasInternalModem EQU 0 ; [r ] 1=internal modem installed
intModemRingDetect EQU 1 ; [r ] 1=internal modem has detected a ring
intModemOffHook EQU 2 ; [r ] 1=internal modem is off hook
intModemRingWakeEnb EQU 3 ; [r/w] 1=wakeup on ring is enabled
extModemSelected EQU 4 ; [r/w] 1=external modem selected
modemSetBit EQU 15 ; 1=set bit, 0=clear bit
; hard disk spindown notification queue element
HDQueueElement RECORD 0, INCREMENT
hdQLink DS.L 1 ; pointer to next queue element
hdQType DS.W 1 ; queue element type (must be HDQType)
hdFlags DS.W 1 ; miscellaneous flags
hdProc DS.L 1 ; pointer to routine to call
hdUser DS.L 1 ; user-defined (variable storage, etc.)
HDqSize EQU *-HDQueueElement
HDPwrQType EQU 'HD' ; queue element type
ENDR
; information returned by the GetScaledBatteryInfo selector
BatteryInfo RECORD 0, INCREMENT
flags DS.B 1 ; misc flags (see below)
warningLevel DS.B 1 ; scaled warning level (0-255)
reserved DS.B 1 ; reserved for internal use
batteryLevel DS.B 1 ; scaled battery level (0-255)
; bits in BatteryInfo.flags:
batteryInstalled EQU 7 ; 1=battery is currently connected
batteryCharging EQU 6 ; 1=battery is being charged
chargerConnected EQU 5 ; 1=charger is connected to the PowerBook
; (this doesn't mean the charger is plugged in)
ENDR
; information returned by the GetBatteryTime selector (times are in seconds)
BatteryTimeRec RECORD 0, INCREMENT
expectedBatteryTime DS.L 1 ; estimated battery time remaining
minimumBatteryTime DS.L 1 ; minimum battery time remaining
maximumBatteryTime DS.L 1 ; maximum battery time remaining
timeUntilCharged DS.L 1 ; time remaining until the battery is fully charged
ENDR
; PowerMgrDispatch routine macros
MACRO
_PMSelectorCount
MOVEQ #PwrMgrCountDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_PMFeatures
MOVEQ #PMFeaturesDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetSleepTimeout
MOVEQ #GetSleepTODisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SetSleepTimeout
SWAP D0
MOVE.W #SetSleepTODisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetHardDiskTimeout
MOVEQ #GetHDTODisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SetHardDiskTimeout
SWAP D0
MOVE.W #SetHDTODisp,D0
_PowerMgrDispatch
ENDM
MACRO
_HardDiskPowered
MOVEQ #HDPoweredDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SpinDownHardDisk
MOVEQ #HDOffDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_IsSpindownDisabled
MOVEQ #IsHDDisableDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SetSpindownDisable
SWAP D0
MOVE.W #HDDisableDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_HardDiskQInstall
MOVEQ #HDQInstallDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_HardDiskQRemove
MOVEQ #HDQRemoveDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetScaledBatteryInfo
SWAP D0
MOVE.W #GetScaleBattDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_AutoSleepControl
MOVEQ #AutoSlpControlDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SelectIntModem
MOVEQ #SelectIntModemDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetIntModemInfo
MOVEQ #ModemInfoDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_MaximumProcessorSpeed
MOVEQ #MaxSpeedDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_CurrentProcessorSpeed
MOVEQ #CurrentSpeedDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_FullProcessorSpeed
MOVEQ #FullSpeedDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SetProcessorSpeed
SWAP D0
MOVE.W #SetSpeedDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetSCSIDiskModeAddress
MOVEQ #GetDiskModeDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SetSCSIDiskModeAddress
SWAP D0
MOVE.W #SetDiskModeDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetWakeupTimer
MOVEQ #GetWakeupDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_SetWakeupTimer
MOVEQ #SetWakeupDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_IsProcessorCyclingEnabled
MOVEQ #GetCPUCycleDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_EnableProcessorCycling
SWAP D0
MOVE.W #SetCPUCycleDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_BatteryCount
MOVEQ #BatteryCountDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetBatteryVoltage
SWAP D0
MOVE.W #AbsoluteBatteryDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetBatteryTimes
SWAP D0
MOVE.W #BatteryTimeDisp,D0
_PowerMgrDispatch
ENDM
MACRO
_GetDimmingTimeout
MOVEQ #GetDimmingTimeout,D0
_PowerMgrDispatch
ENDM
MACRO
_SetDimmingTimeout
SWAP D0
MOVE.W #SetDimmingTimeout,D0
_PowerMgrDispatch
ENDM
MACRO
_DimmingControl
MOVEQ #DimmingControl,D0
_PowerMgrDispatch
ENDM