private static void ARM_SPIN_FOREVER(string msg) { DebugStub.Assert(!Processor.InterruptsDisabled()); Processor p = Processor.CurrentProcessor; DebugStub.WriteLine(msg); DateTime last = DateTime.Now; uint n = 0; while (true) { Thread.Sleep(1000); } }
public static bool InterruptsDisabled() { if ((ProcessPrivileges.GetCurrentPrivileges().AllowedOperations & ProcessPrivileges.Operations.DisableInterrupts) != 0) { return(Processor.InterruptsDisabled()); } // ISSUE: Assert here until all instances get cleaned up from SIPs // This assertion should be removed / replaced with something that would // flag / halt / break only the bogus SIP, not the entire system VTable.Assert(false, "InterruptsDisabled called from unprivileged SIP"); return(false); }
internal static unsafe void SwitchToThreadContextNoGC(ref ThreadContext newContext) { // Interrupts should be disabled at this point VTable.Assert(Processor.InterruptsDisabled()); // Save appears to returns twice: once with true on this thread after // the save, and once with false when the context is restored. if (GetCurrentThreadContext()->threadRecord.spill.Save()) { // Initial return from save; time to swap in the new context. // Must do this on the interrupt stack, since once we release the // dispatch lock the saved context is free to run (and we would // be on the same stack.) fixed(ThreadContext *c = &newContext) { // Note that this does not return. Isa.CallbackOnInterruptStack(resumeThreadCallback, (UIntPtr)c); } } // Saved context will resume here }