532e46c62f
Signed-off-by: Chloe M. <chloe@mensia.org>
42 lines
577 B
C
42 lines
577 B
C
/*
|
|
* Copyright (c) 2026, Chloe M.
|
|
* Provided under the BSD-3 clause.
|
|
*
|
|
* Description: AMD64 MMU management
|
|
* Author: Chloe M.
|
|
*/
|
|
|
|
#include <hal/mmu.h>
|
|
#include <machine/vas.h>
|
|
#include <stdef.h>
|
|
|
|
VOID
|
|
HalMmuReadVas(MMU_VAS *Result)
|
|
{
|
|
if (Result == NULL) {
|
|
return;
|
|
}
|
|
|
|
ASMV(
|
|
"mov %%cr3, %0"
|
|
: "=r" (Result->Cr3)
|
|
:
|
|
: "memory"
|
|
);
|
|
}
|
|
|
|
VOID
|
|
HalMmuWriteVas(MMU_VAS *Vas)
|
|
{
|
|
if (Vas == NULL) {
|
|
return;
|
|
}
|
|
|
|
ASMV(
|
|
"mov %0, %%cr3"
|
|
:
|
|
: "r" (Vas->Cr3)
|
|
: "memory"
|
|
);
|
|
}
|