From 65e17a923fa5bb6afa811c9952c27171f9c3fa59 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Tue, 5 Nov 2019 13:27:40 -0800 Subject: [PATCH] x86: fix z_x86_page_tables_get() for 64-bit Needs a different assembly instruction. Signed-off-by: Andrew Boie --- include/arch/x86/mmustructs.h | 4 ++++ 1 file changed, 4 insertions(+) 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; }