Files
acrn-hypervisor/hypervisor/arch/riscv/pgtable.c
hangliu1 52e7919d9f hv: riscv: add riscv memory interface
Add hypervisor pagetable manipulate interface to riscv arch directory,
which is needed by the common interface, and add riscv ppt pgtable
structure implementation.

Tracked-On: #8831
Signed-off-by: Haicheng Li <haicheng.li@intel.com>
Co-developed-by: hangliu1 <hang1.liu@intel.com>
Signed-off-by: hangliu1 <hang1.liu@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2025-10-21 14:14:55 +08:00

20 lines
423 B
C

/*
* Copyright (C) 2023-2025 Intel Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#include <pgtable.h>
uint64_t arch_pgtl_large(uint64_t pgtle)
{
return (pgtle & PAGE_V) && ((pgtle & PAGE_TYPE_MASK) != PAGE_TYPE_TABLE);
}
uint64_t arch_pgtl_page_paddr(uint64_t pgtle)
{
uint64_t base = (pgtle & PTE_PFN_MASK) >> PAGE_BASE_OFFSET;
return ((base << PTE_SHIFT) & PAGE_PFN_MASK);
}