POK(kernelpart)
event.h
Go to the documentation of this file.
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jan 15 23:34:13 2009
15  */
16 
17 
18 #ifndef __POK_X86_EVENT_H__
19 #define __POK_X86_EVENT_H__
20 
21 #include <types.h>
22 #include <arch/x86/interrupt.h>
23 
24 #include "gdt.h"
25 
26 typedef enum e_idte_type
27 {
28  IDTE_TASK = 5,
31 } e_idte_type;
32 
33 typedef struct
34 {
35  uint32_t offset_low:16;
36  uint32_t segsel:16;
37  uint32_t res0:8;
38  uint32_t type:3;
39  uint32_t d:1;
40  uint32_t res1:1;
41  uint32_t dpl:2;
42  uint32_t present:1;
43  uint32_t offset_high:16;
44 } __attribute__((packed)) idt_entry_t;
45 
46 #define EXCEPTION_DIVIDE_ERROR 0
47 #define EXCEPTION_DEBUG 1
48 #define EXCEPTION_NMI 2
49 #define EXCEPTION_BREAKPOINT 3
50 #define EXCEPTION_OVERFLOW 4
51 #define EXCEPTION_BOUNDRANGE 5
52 #define EXCEPTION_INVALIDOPCODE 6
53 #define EXCEPTION_NOMATH_COPROC 7
54 #define EXCEPTION_DOUBLEFAULT 8
55 #define EXCEPTION_COPSEG_OVERRUN 9
56 #define EXCEPTION_INVALID_TSS 10
57 #define EXCEPTION_SEGMENT_NOT_PRESENT 11
58 #define EXCEPTION_STACKSEG_FAULT 12
59 #define EXCEPTION_GENERAL_PROTECTION 13
60 #define EXCEPTION_PAGEFAULT 14
61 #define EXCEPTION_RESERVED 15
62 #define EXCEPTION_FPU_FAULT 16
63 #define EXCEPTION_ALIGNEMENT_CHECK 17
64 #define EXCEPTION_MACHINE_CHECK 18
65 #define EXCEPTION_SIMD_FAULT 19
66 
67 void pok_idt_set_gate(uint16_t index,
68  uint16_t segsel,
69  uint32_t offset,
70  e_idte_type t,
71  int dpl);
76 
77 #endif /* !__POK_X86_EVENT_H__ */
78