Nucleus
Barry Uninterruptable clone() 960f398 (3 years, 3 months ago)
diff --git a/task/scheduler.c b/task/scheduler.c
index 37e8345..85cc904 100644
--- a/task/scheduler.c
+++ b/task/scheduler.c
@@ -26,19 +26,12 @@ read_eip(void)
static void
switch_to_task(Task *task)
{
- uintptr_t esp, ebp, eip;
- asm volatile("mov %%esp, %0" : "=r" (esp));
- asm volatile("mov %%ebp, %0" : "=r" (ebp));
- eip = (uintptr_t) &&end;
+ asm volatile("mov %%esp, %0" : "=r" (current->esp));
+ asm volatile("mov %%ebp, %0" : "=r" (current->ebp));
+ current->eip = (uintptr_t) &&end;
- current->esp = esp;
- current->ebp = ebp;
- current->eip = eip;
put(current);
current = task; /* Use the passed reference */
- esp = current->esp;
- ebp = current->ebp;
- eip = current->eip;
asm volatile (
"cli;"
@@ -48,7 +41,8 @@ switch_to_task(Task *task)
"movl %3, %%cr3;"
"sti;"
"jmp *%%ecx"
- :: "g" (eip), "g" (esp), "g" (ebp), "g" (current->pageDir)
+ :: "g" (current->eip), "g" (current->esp),
+ "g" (current->ebp), "g" (current->pageDir)
);
end:
}