mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-15 12:00:26 +00:00
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>
20 lines
423 B
C
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);
|
|
}
|