]> git.corax.cc Git - corax/commitdiff
Disable interrupts while we don't have a valid stack in task_switch()
authorMatthias Kruk <m@m10k.eu>
Tue, 24 Sep 2019 08:38:26 +0000 (17:38 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 24 Sep 2019 08:38:26 +0000 (17:38 +0900)
kernel/arch/task.S

index faed92a4a4cb7956a0caf2a6199ed6a57b986322..9f6a19056f49f4ae190183a5824b3217d6fcb60f 100644 (file)
@@ -158,7 +158,7 @@ task_switch:
        movl    4(%esp), %edi
 
        cmpl    %esi, %edi
-       jnz             2f
+       jne             2f
        /* FIXME: Return -EALREADY instead */
        movl    $-1, %eax
        ret
@@ -170,6 +170,12 @@ task_switch:
        cmpl    %ecx, %edx
        jz              2f
 
+       /*
+        * Clear interrupts, since we won't have a valid stack until the
+        * iret instruction in _int_restore is executed
+        */
+       cli
+
        /* switch page directory */
        movl    %ecx, %cr3