]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap/server/src/ARCH-amd64/boot32/boot_idt.S
update
[l4.git] / l4 / pkg / bootstrap / server / src / ARCH-amd64 / boot32 / boot_idt.S
1 /*
2  * (c) 2009 Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9
10 #define GATE_INITTAB_BEGIN(name)        \
11         .text   1                       ;\
12         .globl  name                    ;\
13 name:                                   ;\
14         .text
15
16 #define GATE_ENTRY(n,entry,type)        \
17         .text   1                       ;\
18         .long   entry                   ;\
19         .word   n                       ;\
20         .word   type                    ;\
21         .text
22
23 #define GATE_INITTAB_END                \
24         .text   1                       ;\
25         .long   0                       ;\
26         .text
27
28 #define EXCEPTION(n,name)               \
29         GATE_ENTRY(n,name,0x0e)         ;\
30 name:                                   ;\
31         pushl   $(0)                    ;\
32         pushl   $(n)                    ;\
33         jmp     alltraps
34
35 #define EXCEP_USR(n,name)               \
36         GATE_ENTRY(n,name,0x6e)         ;\
37 name:                                   ;\
38         pushl   $(0)                    ;\
39         pushl   $(n)                    ;\
40         jmp     alltraps
41
42 #define EXCEP_ERR(n,name)               \
43         GATE_ENTRY(n,name,0x0e)         ;\
44 name:                                   ;\
45         pushl   $(n)                    ;\
46         jmp     alltraps
47
48
49 GATE_INITTAB_BEGIN(boot_idt_inittab)
50
51 EXCEPTION(0x00,t_zero_div)
52 EXCEPTION(0x01,t_debug)
53 EXCEPTION(0x02,t_nmi)
54 EXCEP_USR(0x03,t_int3)
55 EXCEP_USR(0x04,t_into)
56 EXCEP_USR(0x05,t_bounds)
57 EXCEPTION(0x06,t_invop)
58 EXCEPTION(0x07,t_nofpu)
59 GATE_ENTRY(0x08,0x20,0x05)
60 EXCEPTION(0x09,a_fpu_over)
61 EXCEP_ERR(0x0a,a_inv_tss)
62 EXCEP_ERR(0x0b,t_segnp)
63 EXCEP_ERR(0x0c,t_stack_fault)
64 EXCEP_ERR(0x0d,t_gen_prot)
65 EXCEP_ERR(0x0e,t_page_fault)
66 EXCEPTION(0x0f,t_trap_0f)
67 EXCEPTION(0x10,t_fpu_err)
68 EXCEPTION(0x11,t_trap_11)
69 EXCEPTION(0x12,t_trap_12)
70 EXCEPTION(0x13,t_trap_13)
71 EXCEPTION(0x14,t_trap_14)
72 EXCEPTION(0x15,t_trap_15)
73 EXCEPTION(0x16,t_trap_16)
74 EXCEPTION(0x17,t_trap_17)
75 EXCEPTION(0x18,t_trap_18)
76 EXCEPTION(0x19,t_trap_19)
77 EXCEPTION(0x1a,t_trap_1a)
78 EXCEPTION(0x1b,t_trap_1b)
79 EXCEPTION(0x1c,t_trap_1c)
80 EXCEPTION(0x1d,t_trap_1d)
81 EXCEPTION(0x1e,t_trap_1e)
82 EXCEPTION(0x1f,t_trap_1f)
83
84 GATE_INITTAB_END
85
86 alltraps:
87         pusha
88         pushl   %ds
89         pushl   %es
90         pushl   %fs
91         pushl   %gs
92
93         movl    %ss,%eax
94         movl    %eax,%ds
95         movl    %eax,%es
96         movl    %esp,%eax
97         pushl   %eax
98         call    trap_dump_panic
99