예제 #1
0
        FreezeProcessor(ref SpillContext threadContext)
        {
            ProcessorContext *context = Processor.GetCurrentProcessorContext();

            if (context->ipiFreeze == Uninitialized)
            {
                // Processor was still being initialized when IPI issued
                while (FreezeRequested == true)
                {
                    ; // just spin until thaw occurs
                }
                return;
            }

            context->ipiFreeze = TargetFrozen;

            while (context->ipiFreeze != TargetThaw && FreezeRequested)
            {
                if ((context->ipiFreeze & FreezeActive) == FreezeActive)
                {
                    //
                    // This processor has been made the active processor
                    //
                    activeCpuContext = context;

                    // Pass state over to debugger stub
                    if (DebugStub.TrapForProcessorSwitch(ref threadContext))
                    {
                        // We're returning to Freeze owner, make it active
                        context->ipiFreeze         &= ~FreezeActive;
                        ownerCpuContext->ipiFreeze |= FreezeActive;
                    }
                }
            }

            context->ipiFreeze = Running;
        }
예제 #2
0
 internal static extern bool TrapForProcessorSwitch(ref SpillContext context);
예제 #3
0
 internal static extern bool Trap(ref SpillContext context, int it);