diff options
Diffstat (limited to 'kernel/drivers/cpu.c')
-rw-r--r-- | kernel/drivers/cpu.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/drivers/cpu.c b/kernel/drivers/cpu.c index 5d53bef..62b0328 100644 --- a/kernel/drivers/cpu.c +++ b/kernel/drivers/cpu.c @@ -91,6 +91,19 @@ void fpu_restore(void) __asm__ volatile("fxrstor (%0)" ::"r"(fpu_state)); } +PROTECTED extern u32 tss_entry; +void tss_set_stack(u32 ss, u32 esp) +{ + assert(tss_entry && ss && esp); + struct { + u32 prev; + u32 esp0; + u32 ss0; + } *tss = (void *)tss_entry; + tss->esp0 = esp; + tss->ss0 = ss; +} + CLEAR static struct cpuid cpuid(u32 code) { u32 a, b, c, d; |