mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-14 10:31:59 +00:00
this patch moves function xx_offset and xx_index to common code, Add arch interface arch_quirk/arch_pgtle_page_vaddr and arch_pgtle_large. Tracked-On: #8831 Signed-off-by: hangliu1 <hang1.liu@intel.com> Reviewed-by: Liu, Yifan1 <yifan1.liu@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
33 lines
1010 B
C
33 lines
1010 B
C
#include <asm/mmu.h>
|
|
#include <asm/pgtable.h>
|
|
|
|
uint64_t arch_pgtl_page_paddr(uint64_t pgtle)
|
|
{
|
|
return pgtle & PFN_MASK;
|
|
}
|
|
|
|
/**
|
|
* @brief Check whether specified page table entry is pointing to huge page.
|
|
*
|
|
* PS(Page Size) flag indicates whether maps a 1-GByte page or 2MByte page or references a page directory table. This function
|
|
* checks this flag. This function is typically used in the context of setting up or modifying page tables where it's
|
|
* necessary to distinguish between large and regular page mappings.
|
|
*
|
|
* It returns the value that bit 7 is 1 if the specified pte maps a 1-GByte or 2MByte page, and 0 if references a page table.
|
|
*
|
|
* @param[in] pgtle The page directory pointer table entry to check.
|
|
*
|
|
* @return The value of PS flag in the PDPTE.
|
|
*
|
|
* @retval PAGE_PSE indicating mapping to a 1-GByte or 2MByte page.
|
|
* @retval 0 indicating reference to a page directory table.
|
|
*
|
|
* @pre N/A
|
|
*
|
|
* @post N/A
|
|
*/
|
|
uint64_t arch_pgtl_large(uint64_t pgtle)
|
|
{
|
|
return pgtle & PAGE_PSE;
|
|
}
|