mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
Kernel: Fix GDT limits
The GDT limits are inclusive, so for correctness we should subtract one from the structs' size.
This commit is contained in:
parent
ee4fc97038
commit
29d9666e02
1 changed files with 2 additions and 2 deletions
|
@ -1074,7 +1074,7 @@ UNMAP_AFTER_INIT void Processor::gdt_init()
|
|||
|
||||
Descriptor fs_descriptor {};
|
||||
fs_descriptor.set_base(VirtualAddress { this });
|
||||
fs_descriptor.set_limit(sizeof(Processor));
|
||||
fs_descriptor.set_limit(sizeof(Processor) - 1);
|
||||
fs_descriptor.dpl = 0;
|
||||
fs_descriptor.segment_present = 1;
|
||||
fs_descriptor.granularity = 0;
|
||||
|
@ -1086,7 +1086,7 @@ UNMAP_AFTER_INIT void Processor::gdt_init()
|
|||
|
||||
Descriptor tss_descriptor {};
|
||||
tss_descriptor.set_base(VirtualAddress { &m_tss });
|
||||
tss_descriptor.set_limit(sizeof(TSS32));
|
||||
tss_descriptor.set_limit(sizeof(TSS32) - 1);
|
||||
tss_descriptor.dpl = 0;
|
||||
tss_descriptor.segment_present = 1;
|
||||
tss_descriptor.granularity = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue