-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathi386-idt.h
62 lines (50 loc) · 1.31 KB
/
i386-idt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef KERNAUX_INCLUDED_ARCH_I386_IDT
#define KERNAUX_INCLUDED_ARCH_I386_IDT
#ifdef __cplusplus
extern "C" {
#endif
#include <kernaux/macro.h>
#include <stdint.h>
#include <kernaux/macro/packing_start.run>
/**
* @brief Interrupt Descriptor Table entry
*
* @see https://en.wikibooks.org/wiki/X86_Assembly/Advanced_Interrupts#The_Interrupt_Descriptor_Table
*/
typedef struct KernAux_Arch_I386_IDTE {
uint16_t offset_low;
uint16_t selector;
uint8_t _;
uint8_t flags;
uint16_t offset_high;
}
KERNAUX_PACKED
KERNAUX_ALIGNED(8)
*KernAux_Arch_I386_IDTE;
KERNAUX_STATIC_TEST_STRUCT_SIZE(KernAux_Arch_I386_IDTE, 8);
#include <kernaux/macro/packing_end.run>
void KernAux_Arch_I386_IDTE_init_intr(
KernAux_Arch_I386_IDTE idte,
uint32_t offset,
uint16_t cs_selector,
uint8_t dpl
);
void KernAux_Arch_I386_IDTE_init_task(
KernAux_Arch_I386_IDTE idte,
uint16_t tss_selector,
uint8_t dpl
);
void KernAux_Arch_I386_IDTE_init_trap(
KernAux_Arch_I386_IDTE idte,
uint32_t offset,
uint16_t cs_selector,
uint8_t dpl
);
uint32_t KernAux_Arch_I386_IDTE_offset(KernAux_Arch_I386_IDTE idte);
uint8_t KernAux_Arch_I386_IDTE_dpl (KernAux_Arch_I386_IDTE idte);
void
KernAux_Arch_I386_IDTE_set_offset(KernAux_Arch_I386_IDTE idte, uint32_t offset);
#ifdef __cplusplus
}
#endif
#endif