mac-rom/Internal/Asm/SlotMgrEqu.a
Elliot Nunn 0ba83392d4 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-09-20 18:04:16 +08:00

229 lines
8.0 KiB
Plaintext

;
; File: SlotMgrEqu.a
;
; Contains: This file contains PRIVATE equates for the slot manager
;
; Written by: George Norman
;
; Copyright: © 1986-1992 by Apple Computer, Inc. All rights reserved.
;
; Change History (most recent first):
;
; <SM4> 10/28/92 SWC Changed SlotEqu.a->Slots.a.
; <SM3> 6/30/92 kc Roll in Horror, comments follow:
; <H4> 6/10/92 djw Add new selector for doSecondaryInit (a private routine)
; <H3> 6/10/92 djw Add new private trap macro's for AddCard, RemoveCard,
; and CheckSlot.
; <SM2> 5/17/92 kc Add get sGetSRTEntry vector number.
; <5> 1/7/92 RB Added a couple of records structures used to identify faulty
; drivers in Apple display cards.
; <4> 1/30/91 gbm sab, #38: Change the Ôalready including this fileÕ variable to
; all uppercase (for security reasons)
; <2> 1/17/90 djw Add new slotmgr private selector GetBoard
; <1.9> 6/30/89 djw removed pSlotStatus.
; <1.8> 4/16/89 GGD Added new data structures used by SlotInterrupts.a and
; VerticalRetraceMgr.a
; <1.7> 4/12/89 djw Removed including slotequ.a and duplicate state constants
; (state_sdminit,...)
; <1.6> 3/28/89 djw added an SRT entries count to globals. Added macros for private
; routines, added last SRT ptr in globals.
; <1.5> 3/12/89 djw changed srt link block and added some mark values, deleted
; SRTlastBlk ptr in globals and substituted expansion chassis
; support fields.
; <1.4> 3/1/89 djw change srrblock flag field from byte to long
; <1.3> 2/20/89 djw added SRT header record definition, added slot mgr globals
; record. added flag field to srrBlock for enable/disable.
; <1.2> 1/6/89 djw Add slotVNum for slot version number
; <1.1> 11/17/88 CCH Added stuff from system build.
; <1.0> 11/9/88 CCH Adding to EASE.
; <1.0> 10/24/88 djw Adding for the first time into EASE.
; 1/10/88 djw created - removed sSDMRecord and state equates
;
;_______________________________________________________________________________________
IF &TYPE('__INCLUDINGSLOTMGREQU__') = 'UNDEFINED' THEN
__INCLUDINGSLOTMGREQU__ SET 1
Include 'Slots.a'
;---------------------------------------------------------------------
;MACRO: sNextStep(VAR Step:Dx; VAR Temp:Dy; VAR sPointer:An)
; sNextStep creates a new pointer from the given pointer and step
; register. The step register is updated for the next call.
; NOTE: &Temp must be CLEAR in bits 8..15.
;---------------------------------------------------------------------
MACRO
sNextStep &Step,&Temp,&sPointer
MOVE.B &Step,&Temp ;&Temp <- the Least Significant Byte of the Step register.
ADD.W &Temp,&sPointer ;&sPointer <- &sPointer + Step[x]
@M10 ROR.L #8,&Step ;&Step <- the next step value.
TST.B &Step ;IF (the next step value is zero) THEN
BEQ.S @M10 ; GOTO @M10 {Skip it}
ENDM
;=====================================================================
; Constants
;=====================================================================
slotVNum EQU 2 ; if new slot manager is in ROM <1.3>
; 1 if slot manager has been patched
; 0 if not present - really an error
srDisable EQU 0 ; bit number for srrFlags - set = disabled <1.3>
;these are apple internal only, never roll into equates
srrBlock RECORD 0 ;Slot Resource Table Record.
srrSlot DS.B 1 ; Slot
srrId DS.B 1 ; Id
srrExtDev DS.B 1 ; External Device <C663>
srrHWDev DS.B 1 ; Hardware device id. <1.3>
srrRefNum DS.W 1 ; RefNum of driver
srrIOReserved DS.W 1 ; Reserved
srrCategory DS.W 1 ; sType: Category
srrCType DS.W 1 ; Type
srrDrvrSW DS.W 1 ; DrvrSW
srrDrvrHW DS.W 1 ; DrvrHW
srrsRsrcPtr DS.L 1 ; Pointer to sResource
srrFlags DS.L 1 ; flag field <1.4>
SRTRecSize EQU * ; Size of se parameter Block
ENDR
srtLink RECORD 0 ; SRT link block <1.5>
srtMarker DS.W 1 ; place holder for marker
srtNext DS.L 1 ; ptr to next srt block, or nil
srtLinkSize EQU * ; size of srt link record
ENDR
srtend EQU $FFFF ; end of the srt blk and start of link block <1.5>
srtfree EQU $FF01 ; a free entry <1.5>
srtMaxEntries EQU 8 ; 8 entries per SRT block <1.3>
srtBlkSize EQU srtMaxEntries*srrBlock.SRTRecSize ; size of srt blocks to allocate <1.3>
SlotRsrcType RECORD 0 ;Slot Resource Type.
sCategory DS.W 1 ; sType: Category
sCType DS.W 1 ; Type
sDrvrSW DS.W 1 ; DrvrSW
sDrvrHW DS.W 1 ; DrvrHW
SRSize EQU * ; Size of Slot resource type.
ENDR
seHeader2 RECORD 0 ;Record structure of sExec Block, Revision-2.
seRevision DS.B 1 ; Revision of seBlock. Revision = 2. {Must be same field as se1Block}
seCPUId DS.B 1 ; Id of CPU
seTimeOut DS.W 1 ; Time Out
seCodeOffset DS.L 1 ; Offset to code.
ENDR
; Slot Manager global variables - globals are a negative offset from sInfoPtr.
slotGlobals RECORD 0,DECR ; global variables for slot manager <1.3>
BusUseCnt DS.W 1 ; count for usage of exception vector - when zero restore saved one
entryMMUMode DS.W 1 ; saved mmu mode when bus exception was swapped
sysBusExcptn DS.L 1 ; saved bus exception vector
slotBusExcptn DS.L 1 ; slot manager's bus exception vector
lastSRTPtr DS.L 1 ; ptr to the last entry in the SRT <1.6>
srtCnt DS.W 1 ; number of entries in the SRT <1.6>
expnSlot DS.B 1 ; expansion chassis slot number <1.5>
expnId DS.B 1 ; expansion chassis sRsrc id <1.5>
slotGlobalSize EQU slotGlobals-*
ENDR
; <5> rb, from Terror
DevTblRec Record 0 ; CardDevice identification record.
category Ds.w 1 ; spCategory
cType Ds.w 1 ; spCType
drvrSW Ds.w 1 ; spDrvrSW
drvrHW Ds.w 1 ; spDrvrHW
drvrVers Ds.w 1 ; driver version number
DTEntrySize Equ *
Endr
LoadTBlRec Record 0 ; Table of device parameter offsets.
ltAddrOff Ds.l 1 ; Offset to driver code.
ltSizeOff Ds.l 1 ; Offset to size of driver.
ltSpID Ds.b 1 ; Kind of spID to look for.
ltSpExtDev Ds.b 1 ; Multiple devices?
ltPadding Ds.b 2 ; Padding (for alignment).
LTEntrySize Equ *
Endr
; Slot manager private routines - these routines are accessed through <1.6>
; the vector table, but not the trap dispatcher.
macro
slotjsr &selector
pea @resume
move.l ([SDMJmpTblPtr],&selector*4),-(sp)
rts
@resume
endm
sDoSecondary equ $0f ; <h4> djw
sAddCard equ $1e ; <h3> djw
sRemoveCard equ $1f ; <h3> djw
sCheckSlot equ $27 ; <h3> djw
NewSRTEntry equ $34
InitEntry equ $35
SrToSpBlock equ $36
Read4Bytes equ $37
GetBoard equ $38 ; <2>
BusException equ $39
InstallBus equ $3A
RestoreBus equ $3B
AllocSRTBlk equ $3C
sGetSRTEntry equ $3D
; Slot manager sustem private routines which are accessed through the trap dispatcher.
macro ; <h3> djw
_AddCard
moveq.l #sAddCard,d0
_SlotManager
endm
macro ; <h3> djw
_RemoveCard
moveq.l #sRemoveCard,d0
_SlotManager
endm
macro ; <h3> djw
_CheckSlot
moveq.l #sCheckSlot,d0
_SlotManager
endm
; Private data structures used by slot interrupt and VBL processing.
slotVBLInfo record {slotVBLQHdr},increment
ds.w 1 ; unused space, for alignment
slotVBLQHdr ds.b qHeadSize ; slot VBL queue header for this slot
slotTickCount ds.l 1 ; VBL tick count for this slot
sVBLInfoSize equ *-slotVBLInfo
endr
slotIntGlobals record {slotVBLPtrs},increment ; globals pointed to by SlotQDT
slotVBLPtrs ds.l TotalSlots ; pointers to slotIntInfo records, indexed by slot number
ds.l 1 ; filler, reserved
slotIntQHeads ds.l TotalSlots ; pointers to SlotIntQElement records, indexed by slot number
ds.l 1 ; filler, reserved
slotVBLInfos ds.b TotalSlots*slotVBLInfo.sVBLInfoSize ; VBL info record for each possible slot
sIntGlobalSize equ *-slotIntGlobals
endr
ENDIF ; ...already included