DeviceCleanup: DEFINITIONS = BEGIN Reason: TYPE = MACHINE DEPENDENT { turnOff(0) , -- stop fetches to memory other than to controller status block turnOn, -- inverse of turnOff disconnect, -- release resources e.g. special real memory in preparation for booting new system kill, -- prepare for demise of controller microcode (255) }; Await: PROCEDURE [pItem: POINTER TO Item] RETURNS [Reason] = INLINE { RETURN[linkage.Await[pItem]] }; Item: TYPE [2]; Perform: PROCEDURE [reason: Reason] = INLINE { linkage.Perform[reason] }; Linkage: PRIVATE TYPE = RECORD [ Await: PROCEDURE [POINTER TO Item] RETURNS [Reason], Perform: PROCEDURE [Reason] ]; linkage: PRIVATE Linkage; InitializeDeviceCleanup: PRIVATE PROC; -- called early on from DebugNub END. ~-- Cedar Nucleus: device on/off across germ swaps -- DeviceCleanup.mesa -- Andrew Birrell May 25, 1983 6:18 pm Wait until next execution of Perform InitializeSampleCleanup: PROCEDURE [] = BEGIN item: DeviceCleanup.Item; reason: DeviceCleanup.Reason; Following code loops forever - must not call other procedures except INLINE, fixed frame DO reason _ DeviceCleanup.Await[@item]; SELECT reason FROM turnOff => ; turnOn => ; disconnect => ; kill => ; ENDCASE => NULL ENDLOOP END; Execute each waiting cleanup procedure, passing given reason Interrupts should have been previously disabled Ęá˜Jšœ1™1Jšœ™J™'J™JšœĎk œ˜J˜Jš˜J˜šœœœ œ˜"Jšœ Ďc@˜MJšœž˜Jšœ žS˜_Jšœž-˜3J˜J˜—J˜š Ďnœ œ œœœ ˜