mac-rom/Interfaces/AIncludes/Slots.a
Elliot Nunn 4325cdcc78 Bring in CubeE sources
Resource forks are included only for .rsrc files. These are DeRezzed into their data fork. 'ckid' resources, from the Projector VCS, are not included.

The Tools directory, containing mostly junk, is also excluded.
2017-12-26 09:52:23 +08:00

603 lines
17 KiB
Plaintext

;____________________________________________________________________________________________
;
; File: Slots.a
;
; Contains: Public slot manager equates
;
; Written by: George Norman / David Wong
;
; Copyright: © 1990, 1992-1993 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM2> 6/14/93 kc Roll in Ludwig.
; <LW2> 3/24/93 mal (fau,chp) Added sRsrc equ's to support slot block xfers.
; <10> 7/1/92 DCL This file is the replacement for the now obsolete SlotEqu.a.
; Changed the 'including' name to match the new file name.
; <SM2> 5/17/92 kc Roll in Horror changes. Comments follow:
; <SM0> 4/17/91 kc Changed field names in Extended format header to bu unique.
; <H2> 10/29/91 jmp Added the extended format header block for super sRsrc
; directories.
; <9> 8/14/91 JL Changed lower case equ to EQU to match database output
; <8> 1/30/91 gbm sab, #38: Change the Ôalready including this fileÕ variable to
; all uppercase (for security reasons)
; <7> 12/14/90 dba <JDR> make capitalization match Slots.h and Slots.p
; <6> 7/3/90 jmp Added handy mask equates for setting the spTBMask field.
; <4> 3/15/90 djw Delete sNewPtr selector - no longer used
;
;____________________________________________________________________________________________
;
; 1.9 djw 07/14/1989 NEEDED FOR AURORA: Deleted sNewPtr macro. Cleaned up comments.
; 1.8 djw 06/30/1989 delete ZeroSlotAlias, majorInc, and sTotalSlots. Changed minorInc to minorStep.
; 1.7 djw 04/12/1989 added fTempEnabled, got rid of CPU based conditionals, cleaned up unused
; constants.
; 1.6 djw 03/28/1989 changed jmp tbl size
; 1.5 djw 03/12/1989 Added sGetsRsrcPtr
; 1.4 djw 02/28/1989 Removed fDisabled. Added spParamData flags
; 1.3 djw 02/20/1989 Changed ZeroSlotAlias for RBV machines from $0E to $09 for new hardware DVT
; 1.2 djw 02/20/1989 Added _sVersion, _SetsRsrcState, _InsertSRTRec, _GetsRsrc, _GetTypesRsrc
; and FindSRTRec. changed spStackPtr to spParamData, added fDisabled. Added conditional
; OSS stuff for f-19.
; 1.1 CCH 11/17/1988 Added stuff from System Build.
; 1.0 CCH 11/ 9/1988 Adding to EASE.
; END EASE MODIFICATION HISTORY
; 1.4 djw 11/ 7/1988 Added _sInitSlotPRAM and slotzeroalias equ
; 1.3 djw 10/24/1988 NEW SLOTMANAGER VERSION. Added conditionals for onNuMac
; and onHafMac (removed hasRBV conditional). Added new fields
; to sInfoRecord. Moved sNewPtr and sFindBigDevBase from
; SlotMgrEqu.a. Deleted _sIntInstall and _sIntRemove macros
; (duplicates from traps.a).
; 1.2 CSL 10/5/1988 dded support for RBV - slot 0
;¥1.1 CCH 9/14/1988 Updated EASE with the current rev of this file.
;--------------------------------------------------------------------
IF &TYPE('__INCLUDINGSLOTS__') = 'UNDEFINED' THEN
__INCLUDINGSLOTS__ SET 1
; sInfo Array status flags (StatusFlags) in bit numbers
fDontUse EQU 0 ; old slotmgr put fcardIsChanged here
fCardIsChanged EQU 1 ; card is Changed field in StatusFlags field of sInfoArray
fTempEnabled EQU 2 ; slot is temporarily enabled
; spBlock flags (spFlags)
fCkForNext EQU $00 ; check for NEXT sRsrc in SRT (SearchSRT)
fCkReserved EQU $01 ; check reserved field for zero (ReadPBSize)
fWarmStart EQU $02 ; warm start, else cold start (PrimaryInit)
fClear EQU $03 ; clear the memory (sNewPtr)
fSys EQU $04 ; alloc on system heap (sNewPtr)
fConsecBytes EQU $05 ; calc step value for consecutive bytes (CalcStep)
; flag bits for spParamData
fall EQU 0 ; bit 0: set=search enabled/disabled sRsrc's
foneslot EQU 1 ; 1: set=search sRsrc's in given slot only
fnext EQU 2 ; 2: set=search for next sRsrc
; sResource flags (sRsrc_Flags) - flags 8-15 are entered into srt flags field
fOpenAtStart EQU 1 ; open the driver at start time, else do not
f32BitMode EQU 2 ; a 32-bit address will be put into dctlDevBase
; state constants for sInfoRecord
stateNil EQU 0 ; uninitialized sInfoRecord
stateSDMInit EQU 1 ; sInfoRecord initialized - executed InitSDeclMgr
statePRAMInit EQU 2 ; sPRAM record initialized - executed InitSPRAMRec
statePInit EQU 3 ; primary Init executed
stateSInit EQU 4 ; secondary init executed
;Misc masks <6>
catMask EQU $08 ; sets spCategory field of spTBMask (bit 3)
cTypeMask EQU $04 ; sets spCType field of spTBMask (bit 2)
drvrSWMask EQU $02 ; sets spDrvrSW field of spTBMask (bit 1)
drvrHWMask EQU $01 ; sets spDrvrHW field of spTBMask (bit 0)
;Misc constants
sizeSPRAMRec EQU 8 ; size of sPRAM record
smPRAMTop EQU $46 ; address of beginning of slot PRAM area
majorSpace EQU $90 ; high byte of beginning of major space <1.2>
TotalSlots EQU 15 ; number of slot supported <1.5>
minorLast EQU $FEFFFFFF ; last minor slot addr <1.8>
FirstPRAMSlot EQU $9 ; First slot with PRAM allocated <1.7>
sNumSlots EQU 6 ; used for number of slot interrupts supported on via
sFirstSlot EQU $9 ; First slot supported <v1.3>
sLastSlot EQU $E ; The last slot.
minorStep EQU $01000000 ; value to step minor address to next slot <1.8>
retryCnt EQU 100 ; default retry cnt on a Nubus read bus error <v1.3>
lastSDMSelt EQU $3D ;The last SDM selector <1.6>
;--------------------------------------------------------------------- ;start <LW2>
; sResource: sBlockTransferInfo, mBlockTransferInfo bit defines
;---------------------------------------------------------------------
fIsMaster EQU 31
fMstrLockedXfer EQU 30
fMstrXferSz16 EQU 19
fMstrXferSz8 EQU 18
fMstrXferSz4 EQU 17
fMstrXferSz2 EQU 16
fIsSlave EQU 15
fSlvXferSz16 EQU 3
fSlvXferSz8 EQU 2
fSlvXferSz4 EQU 1
fSlvXferSz2 EQU 0 ;end <LW2>
;
; Slot interrupt queue element - Used to install a slot interrupt handler by sInitInstall
;
SlotIntQElement RECORD 0
sqLink DS.L 1 ; Ptr - ptr to next element
sqType DS.W 1 ; INTEGER - queue type ID for validity
sqPrio DS.W 1 ; INTEGER - priority
sqAddr DS.L 1 ; ProcPtr - interrupt service routine
sqParm DS.L 1 ; LONGINT - optional A1 parameter
sqHDSize EQU * ; size of slot queue header element
ENDR
;
; Slot Parameter Block - parameter block to all slot manager routines. All fields
; may be inputs, or outputs.
;
SpBlock RECORD 0
spResult DS.L 1 ; 0 result
spSPointer DS.L 1 ; 4 general pointer
spSize DS.L 1 ; 8 size
spOffsetData DS.L 1 ; C Offset/Data field value (sOffsetData)
spIOFileName DS.L 1 ; 10 Pointer to IOFile name (not used)
spSExecPBlk DS.L 1 ; 14 Pointer to sExec block
spParamData DS.L 1 ; 18 misc parameter data (formerly spStackPtr)
spMisc DS.L 1 ; 1C Misc field for SDM (not used)
spReserved DS.L 1 ; 20 Reserved for future expansion
spIOReserved DS.W 1 ; 24 Reserved field of SRT
spRefNum DS.W 1 ; 26 RefNum
spCategory DS.W 1 ; 28 sResource category
spCType DS.W 1 ; 2A type
spDrvrSW DS.W 1 ; 2C drvrsw
spDrvrHW DS.W 1 ; 2E drvrhw
spTBMask DS.B 1 ; 30 type bit mask (bit 0 set = ignore drvrhw, bit 1 = drvrsw, ...)
spSlot DS.B 1 ; 31 slot number.
spId DS.B 1 ; 32 sResource id
spExtDev DS.B 1 ; 33 external device id
spHwDev DS.B 1 ; 34 hardware device id
spByteLanes DS.B 1 ; 35 bytelanes value from FHeader in the declaration ROM.
spFlags DS.B 1 ; 36 general flags
spKey DS.B 1 ; 37 reserved (not used)
spBlockSize EQU * ; 38 Size of spBlock
ENDR
;
; sInfo Record - general slot information. A record exists for each slot
SInfoRecord RECORD 0 ;Slot information record. sInfo Array[1..NumSlots]
siDirPtr DS.L 1 ; Pointer to directory
siInitStatusA DS.W 1 ; Fundamental Error
siInitStatusV DS.W 1 ; Status returned by vendor Init code
siState DS.B 1 ; Initialization State (Primary, Secondary)
siCPUByteLanes DS.B 1 ; CPU Byte Lanes. Each bit set signifies a byte-lane used.
siTopOfROM DS.B 1 ; Top of ROM = $FssFFFFx, where x is TopOfROM.
siStatusFlags DS.B 1 ; Bit-0:Card is changed
siTOConst DS.W 1 ; Time Out Constant for BusErr
siReserved DS.B 2 ; Reserved, must be 0
sInfoRecSize EQU * ; Size of sInfoRecord
siROMAddr DS.L 1 ; Address of top of ROM (major or minor space) <v1.3>
siSlot DS.B 1 ; slot number <v1.3>
siPadding DS.B 3 ; padding to bring out to next long <v1.3>
sInfoNewSize EQU * ; size of new sInfo record <v1.3>
ENDR
;
; Format header block - declaration ROM format header
;
FHeaderRec RECORD 0
fhDirOffset DS.L 1 ;Offset to directory
fhLength DS.L 1 ;Length of ROM
fhCRC DS.L 1 ;CRC
fhROMRev DS.B 1 ;Revision of ROM
fhFormat DS.B 1 ;Format-2
fhTstPat DS.L 1 ;TestPattern
fhReserved DS.B 1 ;Reserved
fhByteLanes DS.B 1 ;ByteLanes
fhBlockSize EQU *
ENDR
OffsetToDir EQU FHeaderRec.fhDirOffset-FHeaderRec.fhBlockSize+1 ; offset to dir ptr <1.8>
;
; Extended Format header block - extended declaration ROM format header for super sRsrc directories. <H2><SM0>
;
XFHeaderRec RECORD 0
fhXSuperInit Ds.l 1 ;Offset to SuperInit SExecBlock <fhFormat,offset>
fhXSDirOffset Ds.l 1 ;Offset to SuperDirectory <$FE,offset>
fhXEOL Ds.l 1 ;Psuedo end-of-list <$FF,nil>
fhXSTstPat Ds.l 1 ;TestPattern
fhXDirOffset DS.L 1 ;Offset to (minimal) directory
fhXLength DS.L 1 ;Length of ROM
fhXCRC DS.L 1 ;CRC
fhXROMRev DS.B 1 ;Revision of ROM
fhXFormat DS.B 1 ;Format-2
fhXTstPat DS.L 1 ;TestPattern
fhXReserved DS.B 1 ;Reserved
fhXByteLanes DS.B 1 ;ByteLanes
fhXBlockSize EQU *
ENDR
XFHdrExtraSize Equ XFHeaderRec.fhXBlockSize-FHeaderRec.fhBlockSize ; (extended - standard) delta
XOffsetToDir Equ XFHeaderRec.fhXSDirOffset-XFHeaderRec.fhXBlockSize+1 ; offset to super dir ptr
XOffsetToSInit Equ XFHeaderRec.fhXSuperInit-XFHeaderRec.fhXBlockSize+1 ; offset to super dir ptr
SEBlock RECORD 0 ;Parameter block for code executed by sExec.
;------- elements of all seBlocks ------
seSlot DS.B 1 ; Slot number.
seSRsrcId DS.B 1 ; sResource Id.
seStatus DS.W 1 ; Status of code executed by sExec.
seFlags DS.B 1 ; Flags.
seFiller DS.B 3 ; Filler
;------- extensions for sLoad + sBoot ------
seResult DS.L 1 ; Result of sLoad.
seIOFileName DS.L 1 ; Pointer to IOFile name.
seDevice DS.B 1 ; Which device to read from.
sePartition DS.B 1 ; The partition.
seOSType DS.B 1 ; Type of OS.
seReserved DS.B 1 ; Reserved field.
seRefNum DS.B 1 ; RefNum of the driver.
;------- extensions for sBoot ------
seNumDevices DS.B 1 ; Number of devices to load.
seBootState DS.B 1 ; State of StartBoot code.
ALIGN 2
seBlockSize EQU * ; Size of se parameter Block
ENDR
; Slot Manager Selectors:
;
; PRINCIPLE
sReadByte EQU $00
sReadWord EQU $01
sReadLong EQU $02
sGetCString EQU $03
sGetBlock EQU $05
sFindStruct EQU $06
sReadStruct EQU $07
sVersion EQU $08 ; <1.2>
sSetsRsrcState EQU $09 ; <1.2>
sInsertSRTRec EQU $0A ; <1.2>
sGetsRsrc EQU $0B ; <1.2>
sGetTypesRsrc EQU $0C ; <1.2>
; SPECIAL
sReadInfo EQU $10
sReadPRAMRec EQU $11
sPutPRAMRec EQU $12
sReadFHeader EQU $13
sNextSRsrc EQU $14
sNextTypeSRsrc EQU $15
sRsrcInfo EQU $16
sDisposePtr EQU $17
sCkCardStat EQU $18
sReadDrvrName EQU $19
sFindSRTRec EQU $1A ; <1.2>
sFindDevBase EQU $1B
sFindBigDevBase EQU $1C ; <v1.3>
sGetsRsrcPtr EQU $1D ; <1.5>
; Advanced
initSDeclMgr EQU $20
sPrimaryInit EQU $21
sCardChanged EQU $22
sExec EQU $23
sOffsetData EQU $24
sInitPRAMRecs EQU $25
sReadPBSize EQU $26
sCalcStep EQU $28
sInitSRsrcTable EQU $29
sSearchSRT EQU $2A
sUpdateSRT EQU $2B
sCalcSPointer EQU $2C
sGetDriver EQU $2D
sPtrToSlot EQU $2E
sFindSInfoRecPtr EQU $2F
sFindSRsrcPtr EQU $30
sDeleteSRTRec EQU $31
sSecondaryInit EQU $32 ; <1.2>
sInitSlotPRAM EQU $33 ; <v1.4><1.2>
;#####################################################################
; PRINCIPLE
;#####################################################################
MACRO
_SReadByte
MOVEQ #sReadByte,D0
_SlotManager
ENDM
MACRO
_SReadWord
MOVEQ #sReadWord,D0
_SlotManager
ENDM
MACRO
_SReadLong
MOVEQ #sReadLong,D0
_SlotManager
ENDM
MACRO
_SGetCString
MOVEQ #sGetCString,D0
_SlotManager
ENDM
MACRO
_SGetBlock
MOVEQ #sGetBlock,D0
_SlotManager
ENDM
MACRO
_SFindStruct
MOVEQ #sFindStruct,D0
_SlotManager
ENDM
MACRO
_SReadStruct
MOVEQ #sReadStruct,D0
_SlotManager
ENDM
MACRO
_SVersion
MOVEQ #sVersion,D0
_SlotManager
ENDM
MACRO
_SetSRsrcState
MOVEQ #sSetSRsrcState,D0
_SlotManager
ENDM
MACRO
_InsertSRTRec
MOVEQ #sInsertSRTRec,D0
_SlotManager
ENDM
MACRO
_GetSRsrc
MOVEQ #sGetSRsrc,D0
_SlotManager
ENDM
MACRO
_GetTypeSRsrc
MOVEQ #sGetTypeSRsrc,D0
_SlotManager
ENDM
;#####################################################################
; SPECIAL
;#####################################################################
MACRO
_SReadInfo
MOVEQ #sReadInfo,D0
_SlotManager
ENDM
MACRO
_SReadPRAMRec
MOVEQ #sReadPRAMRec,D0
_SlotManager
ENDM
MACRO
_SPutPRAMRec
MOVEQ #sPutPRAMRec,D0
_SlotManager
ENDM
MACRO
_SReadFHeader
MOVEQ #sReadFHeader,D0
_SlotManager
ENDM
MACRO
_SNextSRsrc
MOVEQ #sNextSRsrc,D0
_SlotManager
ENDM
MACRO
_SNextTypeSRsrc
MOVEQ #sNextTypeSRsrc,D0
_SlotManager
ENDM
MACRO
_SRsrcInfo
MOVEQ #sRsrcInfo,D0
_SlotManager
ENDM
MACRO
_SDisposePtr
MOVEQ #sDisposePtr,D0
_SlotManager
ENDM
MACRO
_SCkCardStat
MOVEQ #sCkCardStat,D0
_SlotManager
ENDM
MACRO
_SReadDrvrName
MOVEQ #sReadDrvrName,D0
_SlotManager
ENDM
MACRO
_FindSRTRec
MOVEQ #sFindSRTRec,D0
_SlotManager
ENDM
MACRO
_SFindDevBase
MOVEQ #sFindDevBase,D0
_SlotManager
ENDM
MACRO
_SFindBigDevBase
MOVEQ #sFindBigDevBase,D0
_SlotManager
ENDM
MACRO
_GetSRsrcPtr
MOVEQ #sGetSRsrcPtr,D0
_SlotManager
ENDM
;#####################################################################
; Advanced
;#####################################################################
MACRO
_InitSDeclMgr
MOVEQ #initSDeclMgr,D0
_SlotManager
ENDM
MACRO
_SPrimaryInit
MOVEQ #sPrimaryInit,D0
_SlotManager
ENDM
MACRO
_SCardChanged
MOVEQ #sCardChanged,D0
_SlotManager
ENDM
MACRO
_SExec
MOVEQ #sExec,D0
_SlotManager
ENDM
MACRO
_SOffsetData
MOVEQ #sOffsetData,D0
_SlotManager
ENDM
MACRO
_SInitPRAMRecs
MOVEQ #sInitPRAMRecs,D0
_SlotManager
ENDM
MACRO
_SReadPBSize
MOVEQ #sReadPBSize,D0
_SlotManager
ENDM
MACRO
_SCalcStep
MOVEQ #sCalcStep,D0
_SlotManager
ENDM
MACRO
_SInitSRsrcTable
MOVEQ #sInitSRsrcTable,D0
_SlotManager
ENDM
MACRO
_SSearchSRT
MOVEQ #sSearchSRT,D0
_SlotManager
ENDM
MACRO
_SUpdateSRT
MOVEQ #sUpdateSRT,D0
_SlotManager
ENDM
MACRO
_SCalcSPointer
MOVEQ #sCalcSPointer,D0
_SlotManager
ENDM
MACRO
_SGetDriver
MOVEQ #sGetDriver,D0
_SlotManager
ENDM
MACRO
_SPtrToSlot
MOVEQ #sPtrToSlot,D0
_SlotManager
ENDM
MACRO
_SFindSInfoRecPtr
MOVEQ #sFindSInfoRecPtr,D0
_SlotManager
ENDM
MACRO
_SFindSRsrcPtr
MOVEQ #sFindSRsrcPtr,D0
_SlotManager
ENDM
MACRO
_SDeleteSRTRec
MOVEQ #sDeleteSRTRec,D0
_SlotManager
ENDM
MACRO
_SecondaryInit
MOVEQ #sSecondaryInit,D0
_SlotManager
ENDM
MACRO
_InitSlotPRAM
MOVEQ #sInitSlotPRAM,D0
_SlotManager
ENDM
ENDIF ; ...already included