<> <> <> <<>> <> <<>> DIRECTORY DragonOpsIO; SloBridgeOps: CEDAR DEFINITIONS IMPORTS DragonOpsIO ~ BEGIN <> <> <<- Directed access: any cache may be accessed by specifying its DevNum (equal to it's DynaBus ID)>> <<- Broadcast access: a processor may write a given register in all caches simultaneously>> <> <> DevID: TYPE ~ DragonOpsIO.DevID; IOAddress: TYPE ~ DragonOpsIO.IOAddress; WORD: TYPE ~ DragonOpsIO.WORD; DevNum: TYPE ~ [0 .. 16); -- Identifies uniquely a SloBridge ITAction: TYPE ~ MACHINE DEPENDENT RECORD [ -- Action taken to signal an interrupt unused(0:0..15): [0..65535], -- 16 unused bits reason(0:16..20): [0..32), -- bit number of reason to be raised in cache broadcast(0:21..21): BOOLEAN, -- all caches signalled if TRUE cache(0:22..31): DevID]; -- cache ID to be signalled if broadcast is FALSE <> <> <> <> <> <> <> ReadInterruptStatus: PROC [n: DevNum] RETURNS [itStatus: WORD] ~ INLINE { itStatus _ DragonOpsIO.IORead[Addr[n, itStatusReg]]; }; <> <> <> WriteInterruptMask: PROC [n: DevNum, itMask: WORD] ~ INLINE { DragonOpsIO.IOWrite[Addr[n, itMaskReg], itMask]; }; <> <> <> <<>> <<>> WriteInterruptMaskBroadcast: PROC [itMask: WORD] ~ INLINE { DragonOpsIO.BIOWrite[BroadcastAddr[itMaskReg], itMask]; }; <> <> <> <<>> <<>> ReadInterruptMask: PROC [n: DevNum] RETURNS [itMask: WORD] ~ INLINE { itMask _ DragonOpsIO.IORead[Addr[n, itMaskReg]]; }; <> <> <> WriteInterruptAction: PROC [n: DevNum, itAction: ITAction] ~ INLINE { DragonOpsIO.IOWrite[Addr[n, itActionReg], LOOPHOLE[itAction]]; }; <> <> <<>> <<>> WriteInterruptActionBroadcast: PROC [itAction: ITAction] ~ INLINE { DragonOpsIO.BIOWrite[BroadcastAddr[itActionReg], LOOPHOLE[itAction]]; }; <> <> <<>> <<>> ReadInterruptAction: PROC [n: DevNum] RETURNS [itAction: ITAction] ~ INLINE { itAction _ LOOPHOLE[DragonOpsIO.IORead[Addr[n, itActionReg]]]; }; <> <> <> <> <<>> Offset: TYPE ~ [0 .. 256); -- Offset of a register inside the cache itStatusReg: Offset = 0; -- offset to InterruptStatus - May still change itMaskReg: Offset = 1; -- offset to InterruptMask - May still change itActionReg: Offset = 2; -- offset to InterruptAction - May still change SloBridgeBase: WORD = 0; -- Some value to be defined later Addr: PROC [n: DevNum, offset: Offset] RETURNS [addr: IOAddress] ~ INLINE { dev: WORD _ n; addr.v _ SloBridgeBase+1024*dev+offset; }; BroadcastAddr: PROC [offset: Offset] RETURNS [addr: IOAddress] ~ INLINE { addr.v _ SloBridgeBase+offset; }; END.