diff --git a/headers/private/kernel/arch/x86/64/cpu.h b/headers/private/kernel/arch/x86/64/cpu.h index a5bb7e7be7..a29891d5de 100644 --- a/headers/private/kernel/arch/x86/64/cpu.h +++ b/headers/private/kernel/arch/x86/64/cpu.h @@ -45,4 +45,11 @@ x86_context_switch(arch_thread* oldState, arch_thread* newState) } +static inline void +x86_swap_pgdir(uintptr_t root) +{ + asm volatile("movq %0, %%cr3" : : "r" (root)); +} + + #endif // _KERNEL_ARCH_X86_64_CPU_H diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index 900f3c666b..88c5eb8e6a 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -455,7 +455,6 @@ void __x86_setup_system_time(uint32 conversionFactor, void x86_userspace_thread_exit(void); void x86_end_userspace_thread_exit(void); -void x86_swap_pgdir(addr_t newPageDir); void x86_fxsave(void* fpuState); void x86_fxrstor(const void* fpuState); void x86_noop_swap(void* oldFpuState, const void* newFpuState); @@ -480,6 +479,8 @@ void x86_page_fault_exception(iframe* iframe); #ifndef __x86_64__ +void x86_swap_pgdir(addr_t newPageDir); + uint64 x86_read_msr(uint32 registerNumber); void x86_write_msr(uint32 registerNumber, uint64 value); diff --git a/src/system/kernel/arch/x86/64/arch.S b/src/system/kernel/arch/x86/64/arch.S index 9bd3f16885..4cdd22af84 100644 --- a/src/system/kernel/arch/x86/64/arch.S +++ b/src/system/kernel/arch/x86/64/arch.S @@ -69,13 +69,6 @@ FUNCTION(x86_64_thread_entry): FUNCTION_END(x86_64_thread_entry) -/* void x86_swap_pgdir(uint64 newPageDir); */ -FUNCTION(x86_swap_pgdir): - movq %rdi, %cr3 - ret -FUNCTION_END(x86_swap_pgdir) - - /* thread exit stub */ .align 8 FUNCTION(x86_userspace_thread_exit):