feat: add support for process to conduct Intel x87 and MMX related task.
[lunaix-os.git] / lunaix-os / includes / arch / x86 / interrupts.h
index b608cd6217a2f22d028746ac42ecaf0c2f637148..70e7149596aea3b326da00f80d7e6a3b2cd20b3f 100644 (file)
@@ -1,7 +1,28 @@
 #ifndef __LUNAIX_INTERRUPTS_H
 #define __LUNAIX_INTERRUPTS_H
 
-typedef struct {
+#include "vectors.h"
+
+#ifndef __ASM__
+#include <hal/cpu.h>
+typedef struct
+{
+    struct
+    {
+        reg32 eax;
+        reg32 ebx;
+        reg32 ecx;
+        reg32 edx;
+        reg32 edi;
+        reg32 ebp;
+        reg32 esi;
+        reg32 ds;
+        reg32 es;
+        reg32 fs;
+        reg32 gs;
+        reg32 esp;
+    } registers;
+
     unsigned int vector;
     unsigned int err_code;
     unsigned int eip;
@@ -11,10 +32,22 @@ typedef struct {
     unsigned int ss;
 } __attribute__((packed)) isr_param;
 
+typedef void (*int_subscriber)(const isr_param*);
+
 void
-_asm_isr0();
+intr_subscribe(const uint8_t vector, int_subscriber);
 
 void
-interrupt_handler(isr_param* param);
+intr_unsubscribe(const uint8_t vector, int_subscriber);
+
+void intr_set_fallback_handler(int_subscriber);
+
+void
+intr_handler(isr_param* param);
+
+void
+intr_routine_init();
+
+#endif
 
 #endif /* __LUNAIX_INTERRUPTS_H */