10typedef struct _sv48_pte
33#define pte_is_stem(pte) ((pte)->r == 0 && (pte)->w == 0 && (pte)->x == 0 && (pte)->valid)
34#define pte_is_huge(pte) (((pte)->r || (pte)->w || (pte)->x) && (pte)->valid)
36#define pte_set_ppn_stem(pte, _ppn) ((pte)->valid = 1, (pte)->ppn = _ppn, (pte)->r = 0, (pte)->w = 0, (pte)->x = 0)
37#define pte_set_ppn_huge(pte, _ppn) ((pte)->valid = 1, (pte)->ppn = _ppn, (pte)->r = 1, (pte)->w = 0, (pte)->x = 0)
68 __asm__
volatile(
"wfi");
69 __builtin_unreachable();
74 __asm__
volatile(
"sfence.vma %0" : :
"r"(vaddr) :
"memory");
137#if MOS_CONFIG(PML2_HUGE_CAPABLE)
187#if MOS_CONFIG(PML3_HUGE_CAPABLE)
237#if MOS_CONFIG(PML4_HUGE_CAPABLE)
238bool platform_pml4e_is_huge(
const pml4e_t *pml4)
void platform_pml3e_set_pml2(pml3e_t *pml3, pml2_t pml2, pfn_t pml2_pfn)
void platform_pml2e_set_flags(pml2e_t *pml2, vm_flags flags)
#define pte_set_ppn_stem(pte, _ppn)
void platform_pml4e_set_flags(pml4e_t *pml4, vm_flags flags)
bool platform_pml4e_get_present(const pml4e_t *pml4)
void platform_pml1e_set_pfn(pml1e_t *pml1, pfn_t pfn)
vm_flags platform_pml3e_get_flags(const pml3e_t *pml3e)
bool platform_pml3e_get_present(const pml3e_t *pml3)
#define pte_set_ppn_huge(pte, _ppn)
vm_flags platform_pml4e_get_flags(const pml4e_t *pml4e)
should_inline void pmle_set_flags(int level, sv48_pte_t *pte, vm_flags flags)
vm_flags platform_pml1e_get_flags(const pml1e_t *pml1e)
pml1_t platform_pml2e_get_pml1(const pml2e_t *pml2)
bool platform_pml2e_get_present(const pml2e_t *pml2)
void platform_pml2e_set_pml1(pml2e_t *pml2, pml1_t pml1, pfn_t pml1_pfn)
pfn_t platform_pml1e_get_pfn(const pml1e_t *pml1e)
void platform_invalidate_tlb(ptr_t vaddr)
void platform_pml1e_set_flags(pml1e_t *pml1, vm_flags flags)
bool platform_pml1e_get_present(const pml1e_t *pml1)
should_inline vm_flags pte_get_flags(const sv48_pte_t *pte)
void platform_halt_cpu(void)
void platform_pml3e_set_flags(pml3e_t *pml3, vm_flags flags)
vm_flags platform_pml2e_get_flags(const pml2e_t *pml2e)
void platform_pml4e_set_pml3(pml4e_t *pml4, pml3_t pml3, pfn_t pml3_pfn)
pml3_t platform_pml4e_get_pml3(const pml4e_t *pml4)
pml2_t platform_pml3e_get_pml2(const pml3e_t *pml3)
bool platform_pml3e_is_huge(const pml3e_t *pml3e)
pfn_t platform_pml2e_get_huge_pfn(const pml2e_t *pml2)
void platform_pml2e_set_huge(pml2e_t *pml2e, pfn_t pfn)
bool platform_pml2e_is_huge(const pml2e_t *pml2e)
void platform_pml3e_set_huge(pml3e_t *pml3e, pfn_t pfn)
pfn_t platform_pml3e_get_huge_pfn(const pml3e_t *pml3)
#define cast_to(value, valtype, desttype)
#define MOS_STATIC_ASSERT