From 31ca5892d8cdc523fbd22d95b9accb0e76c4f234 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 28 Jul 2010 22:51:38 +0800 Subject: [PATCH] Helps if I test in BOTH builds --- Kernel/arch/x86/proc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index bee311aa..94de734f 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -83,6 +83,7 @@ tTSS gaTSSs[MAX_CPUS]; // TSS Array int giProc_BootProcessorID = 0; #else tThread *gCurrentThread = NULL; +tThread *gpIdleThread = NULL; #endif #if USE_PAE Uint32 *gPML4s[4] = NULL; @@ -461,10 +462,10 @@ void Proc_Start(void) // Create Idle Task if(Proc_Clone(0, 0) == 0) { - tThread *cur = Proc_GetCurThread(); - cur->ThreadName = "Idle Thread"; - Threads_SetTickets(0); // Never called randomly - cur->Quantum = 1; // 1 slice quantum + gpIdleThread = Proc_GetCurThread(); + gpIdleThread->ThreadName = "Idle Thread"; + gpIdleThread->NumTickets = 0; // Never called randomly + gpIdleThread->Quantum = 1; // 1 slice quantum for(;;) HALT(); // Just yeilds } @@ -884,7 +885,11 @@ void Proc_Scheduler(int CPU) if(thread == NULL) { //HALT(); //return; + #if USE_MP thread = gaCPUs[CPU].IdleThread; + #else + thread = gpIdleThread; + #endif } #if DEBUG_TRACE_SWITCH -- 2.20.1