kernel/x86_64: implement x86_swap_pgdir in C++

No reason not to inline this function.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
This commit is contained in:
Paweł Dziepak 2014-08-25 22:53:32 +02:00
parent 1eba40776d
commit 4b75a1e237
3 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -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):