X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86_64%2Fproc.c;h=573947021382b9445b16dd0a1ee6b0ac0fd59267;hb=c6b68cc230c9b6564e2809aca3119ec8118e72ac;hp=81b8eeb888dd6b756740a27337115a768cbb1648;hpb=a1b7b0fcbf99e2c53dd6d7ee5961772bf29bdb2b;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86_64/proc.c b/Kernel/arch/x86_64/proc.c index 81b8eeb8..57394702 100644 --- a/Kernel/arch/x86_64/proc.c +++ b/Kernel/arch/x86_64/proc.c @@ -36,7 +36,7 @@ extern void APStartup(void); // 16-bit AP startup code extern Uint GetRIP(void); // start.asm extern Uint64 gInitialPML4[512]; // start.asm extern char gInitialKernelStack[]; -extern tSpinlock glThreadListLock; +extern tShortSpinlock glThreadListLock; extern int giNumCPUs; extern int giNextTID; extern int giTotalTickets; @@ -387,7 +387,7 @@ void Proc_Start(void) { gaCPUs[0].IdleThread = Proc_GetCurThread(); gaCPUs[0].IdleThread->ThreadName = "Idle Thread"; - gaCPUs[0].IdleThread->NumTickets = 0; // Never called randomly + Threads_SetPriority( gaCPUs[0].IdleThread, -1 ); // Never called randomly gaCPUs[0].IdleThread->Quantum = 1; // 1 slice quantum for(;;) HALT(); // Just yeilds } @@ -761,18 +761,22 @@ void Proc_Scheduler(int CPU) // Error Check if(thread == NULL) { thread = gaCPUs[CPU].IdleThread; - Warning("Hmm... Threads_GetNextToRun returned NULL, I don't think this should happen.\n"); + //Warning("Hmm... Threads_GetNextToRun returned NULL, I don't think this should happen.\n"); + //LogF("Zzzzz.\n"); return; } #if DEBUG_TRACE_SWITCH - Log("Switching to task %i, CR3 = 0x%x, RIP = %p", + LogF("Switching to task %i, CR3 = 0x%x, RIP = %p", thread->TID, thread->MemState.CR3, thread->SavedState.RIP ); #endif + + if(CPU > MAX_CPUS) + LogF("CPU = %i", CPU); // Set current thread gaCPUs[CPU].Current = thread;