BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / 99d3ce8c89383289c5183f690345c2621e7bbd48 / task / switch.S

// Related

Nucleus

Barry Priority preemption in scheduler 99d3ce8 (3 years, 1 month ago)
diff --git a/task/switch.S b/task/switch.S
index 54769af..07f1e56 100644
--- a/task/switch.S
+++ b/task/switch.S
@@ -14,11 +14,14 @@ context_switch:
 	cli
 	mov 4(%esp), %ecx
 	mov 8(%esp), %eax
-	mov 12(%esp), %esi
-	mov 16(%esp), %edi
-	mov 20(%esp), %ebx
+	mov 12(%esp), %ebx
+	mov 16(%esp), %esi
+	mov 20(%esp), %edi
 	mov 24(%esp), %ebp
 	mov 28(%esp), %esp
+	test %eax, %eax
+	je 1f
 	mov %eax, %cr3
+1:
 	sti
 	jmp *%ecx