- "mov %4, %%cr3\n\t" // Set address space
- "mov %1, %%esp\n\t" // Restore ESP
- "mov %2, %%ebp\n\t" // and EBP
- "or %5, 72(%%ebp)\n\t" // or trace flag to eflags (2+2+4+8+2)*4
- "jmp *%3" : : // And return to where we saved state (Proc_Clone or Proc_Scheduler)
- "a"(SWITCH_MAGIC), "b"(thread->SavedState.ESP),
- "d"(thread->SavedState.EBP), "c"(thread->SavedState.EIP),
+ "mov %3, %%cr3\n\t" // Set address space
+ "mov %0, %%esp\n\t" // Restore ESP
+ "mov %1, %%ebp\n\t" // and EBP
+ "test %4, %4\n\t"
+ "jz 1f\n\t"
+ "or %4, 72(%%ebp)\n\t" // or trace flag to eflags (2+2+4+8+2)*4
+ "1:"
+ "xor %%eax, %%eax\n\t"
+ "jmp *%2" : : // And return to where we saved state (Proc_Clone or Proc_Scheduler)
+ "r"(thread->SavedState.ESP),
+ "r"(thread->SavedState.EBP),
+ "r"(thread->SavedState.EIP),