From 168692f09d27caa38b614cf1981b3255b67ff71b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 25 Mar 2024 14:15:43 -0600 Subject: [PATCH] x86: use initial_top for tss stack --- src/context/arch/x86.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/arch/x86.rs b/src/context/arch/x86.rs index 4d6b3963d1..f16d72d61f 100644 --- a/src/context/arch/x86.rs +++ b/src/context/arch/x86.rs @@ -132,7 +132,7 @@ pub unsafe fn empty_cr3() -> rmm::PhysicalAddress { /// Switch to the next context by restoring its stack and registers pub unsafe fn switch_to(prev: &mut super::Context, next: &mut super::Context) { if let Some(ref stack) = next.kstack { - crate::gdt::set_tss_stack(stack.as_ptr() as usize + stack.len()); + crate::gdt::set_tss_stack(stack.initial_top() as usize); } crate::gdt::set_userspace_io_allowed(next.arch.userspace_io_allowed);