Update PTI patch to inline PTI functions
This commit is contained in:
@@ -118,13 +118,7 @@ pub unsafe fn switch() -> bool {
|
||||
(&mut *from_ptr).running = false;
|
||||
(&mut *to_ptr).running = true;
|
||||
if let Some(ref stack) = (*to_ptr).kstack {
|
||||
if cfg!(feature = "pti") {
|
||||
use arch::x86_64::pti::{PTI_CPU_STACK, PTI_CONTEXT_STACK};
|
||||
gdt::TSS.rsp[0] = (PTI_CPU_STACK.as_ptr() as usize + PTI_CPU_STACK.len()) as u64;
|
||||
PTI_CONTEXT_STACK = stack.as_ptr() as usize + stack.len();
|
||||
} else {
|
||||
gdt::TSS.rsp[0] = (stack.as_ptr() as usize + stack.len()) as u64;
|
||||
}
|
||||
gdt::set_tss_stack(stack.as_ptr() as usize + stack.len());
|
||||
}
|
||||
CONTEXT_ID.store((&mut *to_ptr).id, Ordering::SeqCst);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user