f1684a8ad1398d52919a4a28d41c01457ecfb886
[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 typedef struct
12 {
13     unsigned int depth;
14     struct
15     {
16         reg32 eax;
17         reg32 ebx;
18         reg32 ecx;
19         reg32 edx;
20         reg32 edi;
21         reg32 ebp;
22         reg32 esi;
23         reg32 ds;
24         reg32 es;
25         reg32 fs;
26         reg32 gs;
27     } __attribute__((packed)) registers;
28
29     union
30     {
31         reg32 esp;
32         volatile struct exec_param* execp;
33     };
34 } __attribute__((packed)) isr_param;
35
36 struct exec_param
37 {
38     isr_param saved_prev_ctx;
39     unsigned int vector;
40     unsigned int err_code;
41     unsigned int eip;
42     unsigned int cs;
43     unsigned int eflags;
44     unsigned int esp;
45     unsigned int ss;
46 } __attribute__((packed));
47
48 #define ISR_PARAM_SIZE sizeof(isr_param)
49
50 void
51 intr_handler(isr_param* param);
52
53 void
54 intr_routine_init();
55
56 #endif
57
58 #endif /* __LUNAIX_INTERRUPTS_H */