mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
Kernel: Use the GS segment for the per-CPU struct
Right now we're using the FS segment for our per-CPU struct. On x86_64 there's an instruction to switch between a kernel and usermode GS segment (swapgs) which we could use. This patch doesn't update the rest of the code to use swapgs but it prepares for that by using the GS segment instead of the FS segment.
This commit is contained in:
committed by
Andreas Kling
parent
42d197cde7
commit
52f9aaa823
@@ -102,9 +102,9 @@ Thread::Thread(NonnullRefPtr<Process> process, NonnullOwnPtr<Region> kernel_stac
|
||||
m_regs.cs = GDT_SELECTOR_CODE0;
|
||||
m_regs.ds = GDT_SELECTOR_DATA0;
|
||||
m_regs.es = GDT_SELECTOR_DATA0;
|
||||
m_regs.fs = GDT_SELECTOR_PROC;
|
||||
m_regs.fs = 0;
|
||||
m_regs.ss = GDT_SELECTOR_DATA0;
|
||||
m_regs.gs = 0;
|
||||
m_regs.gs = GDT_SELECTOR_PROC;
|
||||
} else {
|
||||
m_regs.cs = GDT_SELECTOR_CODE3 | 3;
|
||||
m_regs.ds = GDT_SELECTOR_DATA3 | 3;
|
||||
|
||||
Reference in New Issue
Block a user