395cfe27ee0d599638bf287c36cc62309d3dabc2
[lunaix-os.git] / lunaix-os / includes / arch / x86 / interrupts.h
1 #ifndef __LUNAIX_INTERRUPTS_H
2 #define __LUNAIX_INTERRUPTS_H
3
4 #include "vectors.h"
5
6 #ifndef __ASM__
7 #include <hal/cpu.h>
8
9 struct exec_param
10 {
11     unsigned int vector;
12     unsigned int err_code;
13     unsigned int eip;
14     unsigned int cs;
15     unsigned int eflags;
16     unsigned int esp;
17     unsigned int ss;
18 } __attribute__((packed));
19
20 typedef struct
21 {
22     struct
23     {
24         reg32 eax;
25         reg32 ebx;
26         reg32 ecx;
27         reg32 edx;
28         reg32 edi;
29         reg32 ebp;
30         reg32 esi;
31         reg32 ds;
32         reg32 es;
33         reg32 fs;
34         reg32 gs;
35         // reg32 esp;
36     } __attribute__((packed)) registers;
37
38     union
39     {
40         reg32 esp;
41         struct exec_param* execp;
42     };
43 } __attribute__((packed)) isr_param;
44
45 void
46 intr_handler(isr_param* param);
47
48 void
49 intr_routine_init();
50
51 #endif
52
53 #endif /* __LUNAIX_INTERRUPTS_H */