From 76b4d4408ec450d8f8a3aee7223b67da1ce0e2cb Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 15 Sep 2025 13:01:37 -0400 Subject: kernel/amd64: Add task state segment logic This commit implements the task state segment and splits up processor initialization into two seperate stages. The cpu_conf() function is apart of the first stage and sets up things that should be going by the time the kernel is started / early init. The cpu_init() function runs later functions that initialize further platform specific subsystems. Signed-off-by: Ian Moffett --- src/sys/include/arch/amd64/mdcpu.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sys/include/arch/amd64/mdcpu.h') diff --git a/src/sys/include/arch/amd64/mdcpu.h b/src/sys/include/arch/amd64/mdcpu.h index 0a39eb4..1503adb 100644 --- a/src/sys/include/arch/amd64/mdcpu.h +++ b/src/sys/include/arch/amd64/mdcpu.h @@ -32,6 +32,7 @@ #include #include +#include #define md_spinwait() __ASMV("pause") #define md_intoff() __ASMV("cli") @@ -46,12 +47,14 @@ * @cr3: CR3 register value (PML phys) * @lapic_base: LAPIC register interface base * @x2apic: Has the x2APIC? Is 1 if true + * @tss: Task state segment for this core */ struct mdcore { uint32_t apic_id; uint64_t cr3; void *lapic_base; uint8_t x2apic : 1; + struct tss_entry tss; }; #endif /* !_MACHINE_MDCPU_H_ */ -- cgit v1.2.3