コード例 #1
0
ファイル: HalDevices.cs プロジェクト: Paul1nh0/Singularity
        private static void WaitForMpSyncState(MpSyncState newState,
                                               uint microseconds,
                                               ref bool success)
        {
            Tracing.Log(
                Tracing.Debug,
                "Waiting for MP sync state {0} -> {1} ({2} microseconds)",
                (uint)mpSyncState, (uint)newState, microseconds
                );

            ulong todo    = microseconds * (Processor.CyclesPerSecond / 1000000);
            ulong last    = Processor.CycleCount;
            ulong elapsed = 0;

            success = false;

            while (elapsed < todo)
            {
                ulong now = Processor.CycleCount;
                elapsed += (now - last);
                last     = now;
                if (HalDevicesApic.mpSyncState == newState)
                {
                    success = true;
                    return;
                }
            }
            Tracing.Log(Tracing.Debug, "Mp sync state timed out");
        }
コード例 #2
0
ファイル: HalDevices.cs プロジェクト: Paul1nh0/Singularity
 private static void WaitForMpSyncState(MpSyncState newState)
 {
     Tracing.Log(
         Tracing.Debug,
         "Waiting for MP sync state {0} -> {1} (indefinite)",
         (uint)mpSyncState, (uint)newState
         );
     while (HalDevicesApic.mpSyncState != newState)
     {
         ;
     }
 }
コード例 #3
0
ファイル: HalDevices.cs プロジェクト: Paul1nh0/Singularity
        private static void AnnounceApFail(int nextCpu)
        {
            MpSyncState localMpState = mpSyncState;

            DebugStub.Print("MpState {0}", __arglist(localMpState));
            DebugStub.Break();
            Platform bi = Platform.ThePlatform;

            DebugStub.Print("Cpu {0} failed. ",
                            __arglist(nextCpu));
            DebugStub.Print("GotBack-> Status {0} Count {1:x8}\n",
                            __arglist(bi.MpStatus32, bi.MpCpuCount));
        }
コード例 #4
0
ファイル: HalDevices.cs プロジェクト: Paul1nh0/Singularity
 private static void SetMpSyncState(MpSyncState newState)
 {
     Tracing.Log(Tracing.Debug, "Changing MP sync state {0} -> {1}",
                 (uint)mpSyncState, (uint)newState);
     mpSyncState = newState;
 }