diff --git a/arch/x86/include/ia32/mmustructs.h b/arch/x86/include/ia32/mmustructs.h index bfd3b44befa..fcc8510ce5e 100644 --- a/arch/x86/include/ia32/mmustructs.h +++ b/arch/x86/include/ia32/mmustructs.h @@ -526,6 +526,19 @@ struct x86_mmu_pt { */ void z_x86_dump_page_tables(struct x86_mmu_pdpt *pdpt); +static inline void z_x86_page_tables_set(struct x86_mmu_pdpt *pdpt) +{ + __asm__ volatile("movl %0, %%cr3\n\t" : : "r" (pdpt)); +} + +static inline struct x86_mmu_pdpt *z_x86_page_tables_get(void) +{ + struct x86_mmu_pdpt *ret; + + __asm__ volatile("movl %%cr3, %0\n\t" : "=r" (ret)); + + return ret; +} #endif /* _ASMLANGUAGE */ #endif /* ZEPHYR_ARCH_X86_INCLUDE_IA32_MMUSTRUCTS_H_ */