mac-rom/OS/NetBoot/ATBootUtils.a

102 lines
2.9 KiB
Plaintext
Raw Permalink Normal View History

;EASE$$$ READ ONLY COPY of file <20>ATBootUtils.a<>
; 1.1 PWD 12/12/1989 Added support for self-authenticating images
; 1.0 PWD 10/30/1989 Adding to EASE
; END EASE MODIFICATION HISTORY
INCLUDE 'SysEqu.a' ; System definitions
INCLUDE 'SysErr.a' ; System errors
; for the glue...
INCLUDE 'ToolEqu.a' ; Toolbox definitions
INCLUDE 'Traps.a' ; Traps definitions
INCLUDE 'SlotEqu.a'
;
; from IOTRAPS.TEXT -- Mac OS IO Interface routines for Pascal
;
; Argument- A0: param: Points to Parameter block.
;
; Results- D0: ec: error code.
; <0: OS Call failed.
; 0: All is well.
; Registers- D0: ec: error code
; A0: param: Paramater list address.
; A1: ra: Return Address.
;
MACRO
OsCall
Move.L (SP)+,A1 ;get return address
.**** check this out thoroughly before changing
Move.B (SP)+,D0 ;Get ASync flag. (why was this a word?)
Move.L (SP)+,A0 ;get param pointer.
BNE.S @1
.*
&SysLst[1] ;tell OS to do it Synchronously
BrA.S @2
.*
@1 &SysLst[1] ,async ;Tell OS to do it Asynchronously
@2 Move.W D0,(SP) ;save result
Jmp (A1) ;return to caller
ENDM
; This macro pops the return address into A1, then gets the parameter
; block pointer and puts it into A0. The selector value is passed to the
; macro and put into D0. Then the Slot Manager is called. Status returned
; in D0 is pushed on the stack. Return is made via a JMP (A1).
MACRO
SlotManager
MOVE.L (SP)+,A1 ;get return address
MOVE.L (SP)+,A0 ;get param block ptr
MOVEQ #&SYSLIST[1],D0 ;put selector in D0
_SlotManager
MOVE.W D0,(SP) ;push status
JMP (A1) ;return
ENDM
;FUNCTION ATSReadDrvrName(spBlkPtr: SpBlockPtr): OSErr;
ATSReadDrvrName FUNC EXPORT
_sReadDrvrName EQU $19
SlotManager _sReadDrvrName
ATSNextTypesRsrc FUNC EXPORT
_sNextTypesRsrc EQU $15
SlotManager _sNextTypesRsrc
;FUNCTION ATOpenSlot(paramBlock: ParmBlkPtr; aSync: BOOLEAN): OSErr;
MACRO
OSICall
Move.L (SP)+,A1 ;get return address
.**** check this out thoroughly before changing
Move.B (SP)+,D0 ;Get ASync flag. (why was this a word?)
Move.L (SP)+,A0 ;get param pointer.
BNE.S @1
.*
&SysLst[1] ,immed ;IMMED = special open for slot devices
BrA.S @2
.*
@1 &SysLst[1] ,async+immed ;no reason they can't be async.
@2 Move.W D0,(SP) ;save result
Jmp (A1) ;return to caller
ENDM
ATOpenSlot PROC EXPORT
OSICall _Open
ATPBControl PROC EXPORT
OsCall _Control
ENDP
ATPBOpen PROC EXPORT
OsCall _Open
ENDP
_EndATDrvr PROC EXPORT
ENDP
END