CpuArchLib: Fixed CpuGetMemoryAttributes().

This commit is contained in:
Mikhail Krichanov 2024-12-05 20:46:57 +03:00
parent 79e0eca155
commit 558889562f
1 changed files with 8 additions and 0 deletions

View File

@ -417,8 +417,16 @@ CpuGetMemoryAttributes (
PAGE_ATTRIBUTE PageAttribute;
UINT64 *PageEntry;
ASSERT (Attributes != NULL);
GetCurrentPagingContext (&PagingContext);
if ((PagingContext.MachineType == IMAGE_FILE_MACHINE_I386) &&
((PagingContext.ContextData.Ia32.Attributes & PAGE_TABLE_LIB_PAGING_CONTEXT_IA32_X64_ATTRIBUTES_PAE) == 0)) {
*Attributes = 0;
return EFI_UNSUPPORTED;
}
PageEntry = GetPageTableEntry (&PagingContext, Address, &PageAttribute);
if (PageEntry == NULL) {
*Attributes = 0;