+ if(eip == SWITCH_MAGIC) {
+ __asm__ __volatile__ ( "nop" : : : "eax","ebx","ecx","edx","edi","esi");
+ regs = (tRegs*)(ebp+(2+2)*4); // EBP,Ret + CPU,CurThread
+ #if USE_MP
+ thread = gaCPUs[CPU].Current;
+ #else
+ thread = gCurrentThread;
+ #endif
+ if(thread->bInstrTrace) {
+ regs->eflags |= 0x100; // Set TF
+// LogF("Tracing enabled\n");
+ Log("%p Scheduled (EIP = %p)", thread, thread->SavedState.EIP);
+ }
+ else
+ regs->eflags &= ~0x100;
+
+ return; // Check if a switch happened
+ }