X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Farch%2Fx86%2Fproc.c;h=d7f460fa24b4c370d8e57c7580f6af9a3a5c350f;hb=5fc81fa5e050f48374a6aff5636f3e60313dfc78;hp=5301401eefc84e618d024aca242abc495f2d8fe9;hpb=6c5a509b5e14e097ca537c539bc9babe3b8f0c4c;p=tpg%2Facess2.git diff --git a/Kernel/arch/x86/proc.c b/Kernel/arch/x86/proc.c index 5301401e..d7f460fa 100644 --- a/Kernel/arch/x86/proc.c +++ b/Kernel/arch/x86/proc.c @@ -560,10 +560,11 @@ void Proc_Scheduler(int CPU) __asm__ __volatile__ ("mov %0, %%cr3"::"a"(gCurrentThread->MemState.CR3)); // Switch threads __asm__ __volatile__ ( - "mov %1, %%esp\n\t" - "mov %2, %%ebp\n\t" - "jmp *%3" : : + "mov %1, %%esp\n\t" // Restore ESP + "mov %2, %%ebp\n\t" // and EBP + "jmp *%3" : : // And return to where we saved state (Proc_Clone or Proc_Scheduler) "a"(SWITCH_MAGIC), "b"(gCurrentThread->SavedState.ESP), - "d"(gCurrentThread->SavedState.EBP), "c"(gCurrentThread->SavedState.EIP)); + "d"(gCurrentThread->SavedState.EBP), "c"(gCurrentThread->SavedState.EIP) + ); for(;;); // Shouldn't reach here }