mac-rom/Toolbox/NotificationMgr/SetProcessorLevel.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

51 lines
1.3 KiB
Plaintext

;EASE$$$ READ ONLY COPY of file ÒSetProcessorLevel.aÓ
; 1.1 CCH 11/10/1988 Fixed Header.
; 1.0 CCH 11/ 9/1988 Adding to EASE.
; OLD REVISIONS BELOW
; 1.0 EMT 3/22/88 First time adding Notification Manager sources
; END EASE MODIFICATION HISTORY
;_______________________________________________________________________
; SetProcessorLevel.a
;
; by Ed Tecot
; Copyright 1987 Apple Computer, Inc.
;
; This file contains two short routines which enable the processor state
; modified from C.
;
; Code by Erich Ringewald.
; Color Commentary by Ed Tecot
;_______________________________________________________________________
CASE OBJ
STRING ASIS
; disable()
; Disables all interrupts by setting the processor state to level 7.
; Returns the current level.
disable PROC EXPORT
MOVEQ #0, D0
MOVE SR, D0 ; Get status register
LSR #8, D0 ; Shift priority into low byte
AND #7, D0 ; Mask out trace/supervisor
ORI #$0700, SR ; Force processor to level 7
RTS
ENDPROC
; spl(level)
; Sets the processor level to its argument.
spl PROC EXPORT
MOVE SR, D0 ; Get status register
MOVE 6(SP), D1 ; Get desired level
LSL #8, D1 ; Put it into high byte
AND #$F8FF, D0 ; Mask out level bytes in SR copy
OR D1, D0 ; And put ours in
MOVE D0, SR ; And set the SR
RTS
ENDPROC
END