BarryServer : Git

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

// Related

Nucleus

Barry Safe interrupt disable and restore b5be0ef (3 years, 3 months ago)
diff --git a/task/clone.c b/task/clone.c
index 2d9b8ea..5e425fa 100644
--- a/task/clone.c
+++ b/task/clone.c
@@ -8,20 +8,11 @@
 
 extern TaskQueue *readyQueue[];
 
-/* Read the EIP */
-static uintptr_t
-read_eip(void)
-{
-	uintptr_t eip;
-	asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
-	return eip;
-}
-
 /* Clone a task */
 pid_t
 clone(int flags)
 {
-	asm volatile("cli");
+	uintptr_t ints = irq_disable();
 
 	Task *parent = current, *child = new(&taskType), *tmp;
 	pid_t tid = 0;
@@ -37,6 +28,6 @@ clone(int flags)
 	tid = child->tid;
 	put(child);
 end:
-	asm volatile("sti");
+	irq_restore(ints);
 	return tid;
 }