summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/gdt.h
AgeCommit message (Collapse)Author
3 dayskernel/amd64: Improve GDT implementationQuinn Stephens
* Switched to using macros for the GDT entry bits, to improve clarity and make the code easier to modify. Also got rid of some junk values in a few of the entries. * Shrunk the GDT data array from 256 entries to 7 (GDT_ENTRY_COUNT) since the GDT will only ever use 7 of the entries for now. * Aligned the GDT using __cacheline_aligned, because the GDT entries will be read every time a segment selector is loaded. * Modified code dealing with the GDTR to just use `g_gdtr`, since the same GDT/GDTR is always used. * In `gdt_load()`, changed `eax` -> `ax`, since segment registers are only 16 bits. Also replaced the `gdtr` to just use `g_gdtr`. Additionally, used the inline assembly formatting to supply segment selectors with KERNEL_CS/DS macros. Signed-off-by: Quinn Stephens <quinn@osmora.org> Signed-off-by: Ian Moffett <ian@osmora.org>
2025-05-06kernel/amd64: gdt: Fix indentIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-23kernel/amd64: gdt: Add user CS/DS definesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-06kernel/amd64: tss: Add support for TSSIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
2024-06-04project: Initial commitIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>