BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / d46e09a34ca8cd546f3a4312976cf3b6a5a55ccf / task / clone.c

// Related

Nucleus

Barry Improved context switching and interrupt handling d46e09a (3 years, 2 months ago)
diff --git a/task/clone.c b/task/clone.c
index fe0ad88..93c0b94 100644
--- a/task/clone.c
+++ b/task/clone.c
@@ -62,9 +62,12 @@ clone(int flags)
 	child->pageDir = clone_dir();
 
 	/* Split tasks here */
-	child->eip = (uintptr_t) &&end;
+	asm volatile("mov %%esi, %0" : "=r" (child->esi));
+	asm volatile("mov %%edi, %0" : "=r" (child->edi));
+	asm volatile("mov %%ebx, %0" : "=r" (child->ebx));
 	asm volatile("mov %%esp, %0" : "=r" (child->esp));
 	asm volatile("mov %%ebp, %0" : "=r" (child->ebp));
+	child->eip = (uintptr_t) &&end;
 	add(readyQueue[child->priority], child);
 	tid = child->tid;
 	put(child);