mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
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:
parent
8740a8c056
commit
9e8e93d91d
2 changed files with 4 additions and 6 deletions
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue