summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/cpu.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-02 21:19:49 -0400
committerIan Moffett <ian@osmora.org>2024-07-02 21:25:53 -0400
commit2d7bc823503167276c6d3c40500c3055d4f38938 (patch)
tree2971c86e108f5afa1c622afa511a289d12e7a3e6 /sys/include/arch/amd64/cpu.h
parent52760e9c5e677b76c81e921bbab95da26478f425 (diff)
kernel/amd64: Handle the user GS segment register
This commit introduces usage of swapgs to switch out the GS register with the user GS register. An md_td_kick() function is also introduced to start up user threads. The this_cpu() function uses the GS register to read the current CPU structure using a new "self" field. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/cpu.h')
-rw-r--r--sys/include/arch/amd64/cpu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h
index 16936e9..2ce363c 100644
--- a/sys/include/arch/amd64/cpu.h
+++ b/sys/include/arch/amd64/cpu.h
@@ -42,6 +42,7 @@ struct cpu_info {
size_t lapic_tmr_freq;
struct tss_entry *tss;
struct proc *curtd;
+ struct cpu_info *self;
};
void cpu_startup(struct cpu_info *ci);