Word EventControl(Word resetMask, Word flipMask) { Word oldValue = EventKindControl; /* EventKindControl = (EventKindControl & ~resetMask) ^ flipMask */ EventKindControl = BS_SYM_DIFF(BS_DIFF(EventKindControl, resetMask), flipMask); return oldValue; }
static void shieldProtLower(Shield shield, Seg seg, AccessSet mode) { /* <design/trace/#fix.noaver> */ SHIELD_AVERT_CRITICAL(Seg, seg); AVERT_CRITICAL(AccessSet, mode); if (BS_INTER(SegPM(seg), mode) != AccessSetEMPTY) { shieldSetPM(shield, seg, BS_DIFF(SegPM(seg), mode)); ProtSet(SegBase(seg), SegLimit(seg), SegPM(seg)); } }
EventControlSet EventControl(EventControlSet resetMask, EventControlSet flipMask) { EventControlSet oldValue = EventKindControl; /* EventKindControl = (EventKindControl & ~resetMask) ^ flipMask */ EventKindControl = BS_SYM_DIFF(BS_DIFF(EventKindControl, resetMask), flipMask); return oldValue; }
void (ShieldLower)(Arena arena, Seg seg, AccessSet mode) { Shield shield; AVERT(Arena, arena); shield = ArenaShield(arena); SHIELD_AVERT(Seg, seg); AVERT(AccessSet, mode); /* SegIsSynced(seg) is not changed by the following preserving design.mps.shield.inv.unsynced.suspended and design.mps.shield.inv.prot.shield. */ shieldSetSM(shield, seg, BS_DIFF(SegSM(seg), mode)); /* TODO: Do we need to promptly call shieldProtLower here? It loses the opportunity to coalesce the protection call. It would violate design.mps.shield.prop.inside.access. */ /* shieldQueue(arena, seg); */ shieldProtLower(shield, seg, mode); /* Check queue and segment consistency. */ AVERT(Arena, arena); AVERT(Seg, seg); }