hot fix: remove outdated objcpy
[lunaix-os.git] / lunaix-os / arch / i386 / exceptions / i386_isrm.c
index 1d5950ef37e1a4c12d023cf41c6722b29656a5b0..f1facf91a5a46fe1e3118411c32340c80343d662 100644 (file)
@@ -12,6 +12,7 @@
 
 static char iv_bmp[(IV_EX_END - IV_BASE_END) / 8];
 static isr_cb handlers[TOTAL_IV];
+static ptr_t ivhand_payload[TOTAL_IV];
 
 extern void
 intr_routine_fallback(const isr_param* param);
@@ -89,7 +90,7 @@ isrm_bindirq(int irq, isr_cb irq_handler)
 {
     int iv;
     if (!(iv = isrm_ivexalloc(irq_handler))) {
-        panickf("out of IV resource. (irq=%d)", irq);
+        fail("out of IV resource.");
         return 0; // never reach
     }
 
@@ -117,4 +118,21 @@ isrm_get(int iv)
     assert(iv < 256);
 
     return handlers[iv];
+}
+
+ptr_t
+isrm_get_payload(const isr_param* param)
+{
+    int iv = param->execp->vector;
+    assert(iv < 256);
+
+    return ivhand_payload[iv];
+}
+
+void
+isrm_set_payload(int iv, ptr_t payload)
+{
+    assert(iv < 256);
+
+    ivhand_payload[iv] = payload;
 }
\ No newline at end of file