Complete (almost!) printf fmt support
[lunaix-os.git] / lunaix-os / includes / arch / x86 / interrupts.h
1 #ifndef __LUNAIX_INTERRUPTS_H
2 #define __LUNAIX_INTERRUPTS_H
3
4
5 #define FAULT_DIVISION_ERROR            0
6 #define FAULT_TRAP_DEBUG_EXCEPTION      1
7 #define INT_NMI                         2
8 #define TRAP_BREAKPOINT                 3
9 #define TRAP_OVERFLOW                   4
10 #define FAULT_BOUND_EXCEED              5
11 #define FAULT_INVALID_OPCODE            6
12 #define FAULT_NO_MATH_PROCESSOR         7
13 #define ABORT_DOUBLE_FAULT              8
14 #define FAULT_RESERVED_0                9
15 #define FAULT_INVALID_TSS               10
16 #define FAULT_SEG_NOT_PRESENT           11
17 #define FAULT_STACK_SEG_FAULT           12
18 #define FAULT_GENERAL_PROTECTION        13
19 #define FAULT_PAGE_FAULT                14
20 #define FAULT_RESERVED_1                15
21 #define FAULT_X87_FAULT                 16
22 #define FAULT_ALIGNMENT_CHECK           17
23 #define ABORT_MACHINE_CHECK             18
24 #define FAULT_SIMD_FP_EXCEPTION         19
25 #define FAULT_VIRTUALIZATION_EXCEPTION  20
26 #define FAULT_CONTROL_PROTECTION        21
27
28 #define LUNAIX_SYS_PANIC                32
29
30 #ifndef __ASM__
31 #include <hal/cpu.h>
32 typedef struct {
33     gp_regs registers;
34     unsigned int vector;
35     unsigned int err_code;
36     unsigned int eip;
37     unsigned int cs;
38     unsigned int eflags;
39     unsigned int esp;
40     unsigned int ss;
41 } __attribute__((packed)) isr_param;
42
43 void
44 _asm_isr0();
45
46 void
47 _asm_isr1();
48
49 void
50 _asm_isr2();
51
52 void
53 _asm_isr3();
54
55 void
56 _asm_isr4();
57
58 void
59 _asm_isr5();
60
61 void
62 _asm_isr6();
63
64 void
65 _asm_isr7();
66
67 void
68 _asm_isr8();
69
70 void
71 _asm_isr9();
72
73 void
74 _asm_isr10();
75
76 void
77 _asm_isr11();
78
79 void
80 _asm_isr12();
81
82 void
83 _asm_isr13();
84
85 void
86 _asm_isr14();
87
88 void
89 _asm_isr15();
90
91 void
92 _asm_isr16();
93
94 void
95 _asm_isr17();
96
97 void
98 _asm_isr18();
99
100 void
101 _asm_isr19();
102
103 void
104 _asm_isr20();
105
106 void
107 _asm_isr21();
108
109
110 void
111 _asm_isr32();
112
113 void
114 interrupt_handler(isr_param* param);
115
116 #endif
117
118 #endif /* __LUNAIX_INTERRUPTS_H */