x86: fix z_x86_page_tables_get() for 64-bit

Needs a different assembly instruction.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-11-05 13:27:40 -08:00 committed by Andrew Boie
parent a9e0d14c57
commit 65e17a923f
1 changed files with 4 additions and 0 deletions

View File

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