diff --git a/include/arch/x86/mmustructs.h b/include/arch/x86/mmustructs.h index 0c2406f0d87..f744d7699a6 100644 --- a/include/arch/x86/mmustructs.h +++ b/include/arch/x86/mmustructs.h @@ -352,7 +352,11 @@ static inline struct x86_page_tables *z_x86_page_tables_get(void) { struct x86_page_tables *ret; +#ifdef CONFIG_X86_64 + __asm__ volatile("movq %%cr3, %0\n\t" : "=r" (ret)); +#else __asm__ volatile("movl %%cr3, %0\n\t" : "=r" (ret)); +#endif return ret; }