x86: add functions to get/set page tables
Wrapper to assembly code working with CR3 register. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
ea201b206f
commit
fcd2c14500
1 changed files with 13 additions and 0 deletions
|
@ -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_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue