X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.c;h=fd916438cc21f86c26d65c5396a104e766e068df;hb=eb106b6fa9ebd3710f667b88bcc0924dc0eef099;hp=336bcdb3e5a724da1ccb6627255bb95d05b99495;hpb=4e0a3e1ace04035d141302bd3a5daf287d3cfa31;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index 336bcdb3..fd916438 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -10,6 +10,9 @@ # include #endif +// === FLAGS === +#define DEBUG_TRACE_SWITCH 0 + // === CONSTANTS === #define SWITCH_MAGIC 0xFFFACE55 // There is no code in this area #define TIMER_DIVISOR 11931 //~100Hz @@ -298,7 +301,6 @@ int Proc_Clone(Uint *Err, Uint Flags) newThread->SavedState.EBP = ebp; eip = GetEIP(); if(eip == SWITCH_MAGIC) { - Log("Thread %i running", Proc_GetCurThread()->TID); outb(0x20, 0x20); // ACK Timer and return as child return 0; } @@ -498,6 +500,14 @@ void Proc_Scheduler(int CPU) return; } + #if DEBUG_TRACE_SWITCH + Log("Switching to task %i, CR3 = 0x%x, EIP = %p", + thread->TID, + thread->MemState.CR3, + thread->SavedState.EIP + ); + #endif + // Set current thread gCurrentThread = thread;