31 #include "gdt-layout.h"
32 #include "prot-domains.h"
36 #include "segmentation.h"
46 typedef union intr_gate_desc {
68 static intr_gate_desc_t
__attribute__((aligned(8))) ATTR_BSS_KERN
77 idt_set_intr_gate_desc(
int intr_num,
82 intr_gate_desc_t desc;
84 desc.offset_low = offset & 0xFFFF;
86 desc.fixed =
BIT(9) |
BIT(10);
91 desc.offset_high = (offset >> 16) & 0xFFFF;
93 KERN_WRITEL(idt[intr_num].raw_hi, desc.raw_hi);
94 KERN_WRITEL(idt[intr_num].raw_lo, desc.raw_lo);
107 idtr.limit = (
sizeof(intr_gate_desc_t) * NUM_DESC) - 1;
108 idtr.base = KERN_DATA_OFF_TO_PHYS_ADDR((uint32_t)idt);
111 __asm__(
"lidt %0\n\t" ::
"m" (idtr));
#define __attribute__(nothing)
Define attribute to nothing since it isn't handled by IAR.
#define BIT(x)
Useful to reference a single bit of a byte.