Kernel: Remove storage_segment from IDTEntry constructor

On x86_64 and x86, storage_segment (bit 12 counting from 0)
is always 0 according to the Intel Software Developer's Manual,
volume 3A, section 6.11 and section 6.14.1. It has therefore
been removed as a parameter from IDTEntry's constructor and
hardwired to 0.
This commit is contained in:
Tom Finet 2024-02-18 16:55:31 +00:00 committed by Jelle Raaijmakers
parent 8740a8c056
commit 9e8e93d91d
2 changed files with 4 additions and 6 deletions

View file

@ -121,14 +121,14 @@ struct [[gnu::packed]] IDTEntry
u32 zeros;
IDTEntry() = default;
IDTEntry(FlatPtr callback, u16 selector_, IDTEntryType type, u8 storage_segment, u8 privilege_level)
IDTEntry(FlatPtr callback, u16 selector_, IDTEntryType type, u8 privilege_level)
: offset_1 { (u16)((FlatPtr)callback & 0xFFFF) }
, selector { selector_ }
, interrupt_stack_table { 0 }
, zero { 0 }
, type_attr {
.gate_type = (u8)type,
.storage_segment = storage_segment,
.storage_segment = 0,
.descriptor_privilege_level = (u8)(privilege_level & 0b11),
.present = 1,
}

View file

@ -464,15 +464,13 @@ 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
// FIXME: What's up with that storage segment 0?
s_idt[index] = IDTEntry((FlatPtr)handler, GDT_SELECTOR_CODE0, IDTEntryType::InterruptGate32, 0, 0);
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
// FIXME: What's up with that storage segment 0?
s_idt[index] = IDTEntry((FlatPtr)handler, GDT_SELECTOR_CODE0, IDTEntryType::TrapGate32, 0, 3);
s_idt[index] = IDTEntry((FlatPtr)handler, GDT_SELECTOR_CODE0, IDTEntryType::TrapGate32, 3);
}
UNMAP_AFTER_INIT void flush_idt()