Kernel: Resolve FIXME relating to the gate type arg for x86 Interrupts

According to the Intel Software Developer's Manual Volume 3A section
6.12.1.3, the interrupt gate type means the IF flag is cleared to
prevent nested interruption. The trap gate type does not modify the
IF flag. Thus the gate type argument is important when constructing
an IDTEntry.
This commit is contained in:
Tom Finet 2024-02-18 18:23:49 +00:00 committed by Jelle Raaijmakers
parent 9e8e93d91d
commit 3b6a300ed7
Notes: sideshowbarker 2024-07-18 03:20:18 +09:00

View file

@ -463,13 +463,11 @@ void unregister_generic_interrupt_handler(u8 interrupt_number, GenericInterruptH
UNMAP_AFTER_INIT void register_interrupt_handler(u8 index, void (*handler)())
{
// FIXME: Is the Gate Type really required to be an Interrupt
s_idt[index] = IDTEntry((FlatPtr)handler, GDT_SELECTOR_CODE0, IDTEntryType::InterruptGate32, 0);
}
UNMAP_AFTER_INIT void register_user_callable_interrupt_handler(u8 index, void (*handler)())
{
// FIXME: Is the Gate Type really required to be a Trap
s_idt[index] = IDTEntry((FlatPtr)handler, GDT_SELECTOR_CODE0, IDTEntryType::TrapGate32, 3);
}