refactor: cut off some bloats in intr_ctx
[lunaix-os.git] / lunaix-os / includes / arch / x86 / interrupts.h
index d25fbe3b68d9e931b7062d559b7f9cbf6ad411ed..395cfe27ee0d599638bf287c36cc62309d3dabc2 100644 (file)
@@ -5,6 +5,18 @@
 
 #ifndef __ASM__
 #include <hal/cpu.h>
 
 #ifndef __ASM__
 #include <hal/cpu.h>
+
+struct exec_param
+{
+    unsigned int vector;
+    unsigned int err_code;
+    unsigned int eip;
+    unsigned int cs;
+    unsigned int eflags;
+    unsigned int esp;
+    unsigned int ss;
+} __attribute__((packed));
+
 typedef struct
 {
     struct
 typedef struct
 {
     struct
@@ -20,16 +32,14 @@ typedef struct
         reg32 es;
         reg32 fs;
         reg32 gs;
         reg32 es;
         reg32 fs;
         reg32 gs;
-        reg32 esp;
+        // reg32 esp;
     } __attribute__((packed)) registers;
 
     } __attribute__((packed)) registers;
 
-    unsigned int vector;
-    unsigned int err_code;
-    unsigned int eip;
-    unsigned int cs;
-    unsigned int eflags;
-    unsigned int esp;
-    unsigned int ss;
+    union
+    {
+        reg32 esp;
+        struct exec_param* execp;
+    };
 } __attribute__((packed)) isr_param;
 
 void
 } __attribute__((packed)) isr_param;
 
 void