x86: use initial_top for tss stack

This commit is contained in:
Jeremy Soller
2024-03-25 14:15:43 -06:00
parent c17279f5bf
commit 168692f09d
+1 -1
View File
@@ -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);