fix make for a21, PIDs are always ints, linter things
This commit is contained in:
@@ -10,13 +10,9 @@ constinit struct InterruptDescriptor idt[256] = {};
|
||||
// Struct used for loading (the address of) the Interrupt Descriptor Table into
|
||||
// the IDT-Register
|
||||
struct Register {
|
||||
uint16_t limit; // Address of the last valid byte (relative to base)
|
||||
struct InterruptDescriptor* base;
|
||||
explicit Register(uint8_t max = 255) {
|
||||
limit =
|
||||
(max + static_cast<uint16_t>(1)) * sizeof(InterruptDescriptor) - 1;
|
||||
base = idt;
|
||||
}
|
||||
uint16_t limit =
|
||||
sizeof(idt) - 1; // Address of the last valid byte (relative to base)
|
||||
struct InterruptDescriptor* base = idt;
|
||||
} __attribute__((packed));
|
||||
|
||||
static_assert(sizeof(InterruptDescriptor) == 16,
|
||||
@@ -26,11 +22,11 @@ static_assert(alignof(decltype(idt)) % 8 == 0, "IDT must be 8 byte aligned!");
|
||||
|
||||
void load() {
|
||||
// Create structure required for writing to idtr and load via lidt
|
||||
Register idtr(Core::Interrupt::VECTORS - 1);
|
||||
Register idtr;
|
||||
asm volatile("lidt %0\n\t" ::"m"(idtr));
|
||||
}
|
||||
|
||||
void set(Core::Interrupt::Vector vector, InterruptDescriptor descriptor) {
|
||||
idt[(uint8_t)vector] = descriptor;
|
||||
idt[static_cast<uint8_t>(vector)] = descriptor;
|
||||
}
|
||||
} // namespace IDT
|
||||
|
||||
Reference in New Issue
Block a user