feat: closedir(2)
[lunaix-os.git] / lunaix-os / kernel / asm / x86 / interrupts.c
index 25b3791e7415f73af0d632d3702e020ced94a9a3..3fb24cbc054eab3d955078da2a27d42d35ee00e7 100644 (file)
@@ -19,26 +19,27 @@ extern x86_page_table* __kernel_ptd;
 void
 intr_handler(isr_param* param)
 {
+    param->execp->saved_prev_ctx = __current->intr_ctx;
     __current->intr_ctx = *param;
 
-    isr_param* lparam = &__current->intr_ctx;
+    volatile struct exec_param* execp = __current->intr_ctx.execp;
 
-    if (lparam->vector <= 255) {
-        isr_cb subscriber = isrm_get(lparam->vector);
+    if (execp->vector <= 255) {
+        isr_cb subscriber = isrm_get(execp->vector);
         subscriber(param);
         goto done;
     }
 
     kprint_panic("INT %u: (%x) [%p: %p] Unknown",
-                 lparam->vector,
-                 lparam->err_code,
-                 lparam->cs,
-                 lparam->eip);
+                 execp->vector,
+                 execp->err_code,
+                 execp->cs,
+                 execp->eip);
 
 done:
     // for all external interrupts except the spurious interrupt
     //  this is required by Intel Manual Vol.3A, section 10.8.1 & 10.8.5
-    if (lparam->vector >= IV_EX && lparam->vector != APIC_SPIV_IV) {
+    if (execp->vector >= IV_EX && execp->vector != APIC_SPIV_IV) {
         apic_done_servicing();
     }