mirror of
https://github.com/elliotnunn/mac-rom.git
synced 2025-01-04 01:29:22 +00:00
163 lines
6.1 KiB
Plaintext
163 lines
6.1 KiB
Plaintext
|
;__________________________________________________________________________________________________
|
|||
|
;
|
|||
|
; File: Devices.a
|
|||
|
;
|
|||
|
; Contains: Equate file for drivers/Device Mgr etc.
|
|||
|
;
|
|||
|
; Written by: a little of everyone.
|
|||
|
;
|
|||
|
; Copyright <20> 1988-1993 by Apple Computer, Inc. All rights reserved.
|
|||
|
;
|
|||
|
; Change History (most recent first):
|
|||
|
;
|
|||
|
; <1> 10/14/93 pdw first checked in
|
|||
|
; <1> 9/26/93 pdw first checked in
|
|||
|
;
|
|||
|
;___________________________________________________________________________
|
|||
|
|
|||
|
IF (&TYPE('__Devices__') = 'UNDEFINED') THEN
|
|||
|
__Devices__ SET 1
|
|||
|
|
|||
|
IF &TYPE('__OSUtils__') = 'UNDEFINED' THEN
|
|||
|
INCLUDE 'OSUtils.a'
|
|||
|
ENDIF
|
|||
|
|
|||
|
|
|||
|
statusGetDCE EQU 1 ; get DCE handle; good for all drivers
|
|||
|
|
|||
|
|
|||
|
DCtlEntry RECORD 0
|
|||
|
dCtlDriver DS.L 1 ; Ptr
|
|||
|
dCtlFlags DS.W 1 ; short
|
|||
|
dCtlQHdr DS QHdr
|
|||
|
dCtlPosition DS.L 1 ; long
|
|||
|
dCtlStorage DS.L 1 ; Handle
|
|||
|
dCtlRefNum DS.W 1 ; short
|
|||
|
dCtlCurTicks DS.L 1 ; long
|
|||
|
dCtlWindow DS.L 1 ; WindowPtr
|
|||
|
dCtlDelay DS.W 1 ; short
|
|||
|
dCtlEMask DS.W 1 ; short
|
|||
|
dCtlMenu DS.W 1 ; short
|
|||
|
size EQU *
|
|||
|
ENDR
|
|||
|
|
|||
|
|
|||
|
AuxDCE RECORD 0
|
|||
|
dCtlDriver DS.L 1 ; Ptr
|
|||
|
dCtlFlags DS.W 1 ; short
|
|||
|
dCtlQHdr DS QHdr
|
|||
|
dCtlPosition DS.L 1 ; long
|
|||
|
dCtlStorage DS.L 1 ; Handle
|
|||
|
dCtlRefNum DS.W 1 ; short
|
|||
|
dCtlCurTicks DS.L 1 ; long
|
|||
|
dCtlWindow DS.L 1 ; GrafPtr
|
|||
|
dCtlDelay DS.W 1 ; short
|
|||
|
dCtlEMask DS.W 1 ; short
|
|||
|
dCtlMenu DS.W 1 ; short
|
|||
|
dCtlSlot DS.B 1 ; Byte
|
|||
|
dCtlSlotId DS.B 1 ; Byte
|
|||
|
dCtlDevBase DS.L 1 ; long
|
|||
|
dCtlOwner DS.L 1 ; Ptr
|
|||
|
dCtlExtDev DS.B 1 ; Byte
|
|||
|
fillByte DS.B 1 ; Byte
|
|||
|
size EQU *
|
|||
|
ENDR
|
|||
|
|
|||
|
FollowsNewRules EQU 2 ; New DRVR Rules Bit
|
|||
|
|
|||
|
MACRO
|
|||
|
ParamBlockHeader
|
|||
|
qLink DS.L 1 ; QElemPtr: queue link in header
|
|||
|
qType DS.W 1 ; short: type byte for safety check
|
|||
|
ioTrap DS.W 1 ; short: FS: the Trap
|
|||
|
ioCmdAddr DS.L 1 ; Ptr: FS: address to dispatch to
|
|||
|
ioCompletion DS.L 1 ; ProcPtr: completion routine addr (0 for synch calls)
|
|||
|
ioResult DS.W 1 ; OSErr: result code
|
|||
|
ioNamePtr DS.L 1 ; StringPtr: ptr to Vol:FileName string
|
|||
|
ioVRefNum DS.W 1 ; short: volume refnum (DrvNum for Eject and MountVol)
|
|||
|
MEND
|
|||
|
|
|||
|
|
|||
|
IOParam RECORD 0
|
|||
|
ParamBlockHeader
|
|||
|
ioRefNum DS.W 1 ; short: refNum for I/O operation
|
|||
|
ioVersNum DS.B 1 ; Byte: version number
|
|||
|
ioPermssn DS.B 1 ; Byte: Open: permissions (byte)
|
|||
|
ioMisc DS.L 1 ; Ptr: Rename: new name (GetEOF,SetEOF: logical end of file) (Open: optional ptr to buffer) (SetFileType: new type)
|
|||
|
ioBuffer DS.L 1 ; Ptr: data buffer Ptr
|
|||
|
ioReqCount DS.L 1 ; long: requested byte count; also = ioNewDirID
|
|||
|
ioActCount DS.L 1 ; long: actual byte count completed
|
|||
|
ioPosMode DS.W 1 ; short: initial file positioning
|
|||
|
ioPosOffset DS.L 1 ; long: file position offset
|
|||
|
size EQU *
|
|||
|
ENDR
|
|||
|
|
|||
|
|
|||
|
CntrlParam RECORD 0
|
|||
|
ParamBlockHeader
|
|||
|
ioCRefNum DS.W 1 ; short: refNum for I/O operation
|
|||
|
csCode DS.W 1 ; short: word for control status code
|
|||
|
csParam DS.W 11 ; Array of short: operation-defined parameters
|
|||
|
size EQU *
|
|||
|
ENDR
|
|||
|
|
|||
|
|
|||
|
; status parameter block for drvrGestalt calls
|
|||
|
|
|||
|
DriverGestaltParam RECORD 0
|
|||
|
ParamBlockHeader
|
|||
|
ioCRefNum ds.w 1 ; refNum for I/O operation
|
|||
|
csCode ds.w 1 ; == driverGestaltCode
|
|||
|
driverGestaltSelector ds.l 1
|
|||
|
driverGestaltResponse ds.l 1
|
|||
|
size EQU *
|
|||
|
ENDR
|
|||
|
|
|||
|
|
|||
|
;*** Driver Gestalt Structures ***
|
|||
|
|
|||
|
driverGestaltCode equ 43
|
|||
|
|
|||
|
; Currently defined drvrGestalt selectors
|
|||
|
|
|||
|
driverGestaltSync equ 'sync' ; True if driver only behaves synchronously.
|
|||
|
driverGestaltPrefetch equ 'prft' ; The prefetch buffer characteristics (size and time to prefetch)
|
|||
|
driverGestaltBoot equ 'boot' ; value to place in PRAM for this drive (long)
|
|||
|
|
|||
|
|
|||
|
; Structures for currently defined drvrGestalt selectors
|
|||
|
|
|||
|
driverGestaltBootResponse RECORD 0
|
|||
|
extDev ds.b 1 ; Packed target (upper 5 bits) LUN (lower 3 bits)
|
|||
|
partition ds.b 1 ; Unused
|
|||
|
SIMSlot ds.b 1 ; Slot
|
|||
|
SIMsRSRC ds.b 1 ; sRsrcID
|
|||
|
ENDR
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
; FUNCTION GetDCtlEntry(refNum: INTEGER): DCtlHandle;
|
|||
|
IMPORT GetDCtlEntry
|
|||
|
; FUNCTION SetChooserAlert(f: BOOLEAN): BOOLEAN;
|
|||
|
IMPORT SetChooserAlert
|
|||
|
; FUNCTION OpenDriver(name: Str255;VAR drvrRefNum: INTEGER): OSErr;
|
|||
|
IMPORT OpenDriver
|
|||
|
; FUNCTION CloseDriver(refNum: INTEGER): OSErr;
|
|||
|
IMPORT CloseDriver
|
|||
|
; FUNCTION PBControl(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr;
|
|||
|
IMPORT PBControl
|
|||
|
_PBControlSync OPWORD $A004
|
|||
|
_PBControlAsync OPWORD $A404
|
|||
|
; FUNCTION PBStatus(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr;
|
|||
|
IMPORT PBStatus
|
|||
|
_PBStatusSync OPWORD $A005
|
|||
|
_PBStatusAsync OPWORD $A405
|
|||
|
; FUNCTION PBKillIO(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr;
|
|||
|
IMPORT PBKillIO
|
|||
|
_PBKillIOSync OPWORD $A006
|
|||
|
_PBKillIOAsync OPWORD $A406
|
|||
|
|
|||
|
ENDIF ; ...already included
|