/** @file\r
UEFI PropertiesTable support\r
\r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#define PREVIOUS_MEMORY_DESCRIPTOR(MemoryDescriptor, Size) \\r
((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) - (Size)))\r
\r
-#define IMAGE_PROPERTIES_RECORD_CODE_SECTION_SIGNATURE SIGNATURE_32 ('I','P','R','C')\r
-\r
-typedef struct {\r
- UINT32 Signature;\r
- LIST_ENTRY Link;\r
- EFI_PHYSICAL_ADDRESS CodeSegmentBase;\r
- UINT64 CodeSegmentSize;\r
-} IMAGE_PROPERTIES_RECORD_CODE_SECTION;\r
-\r
-#define IMAGE_PROPERTIES_RECORD_SIGNATURE SIGNATURE_32 ('I','P','R','D')\r
-\r
-typedef struct {\r
- UINT32 Signature;\r
- LIST_ENTRY Link;\r
- EFI_PHYSICAL_ADDRESS ImageBase;\r
- UINT64 ImageSize;\r
- UINTN CodeSegmentCount;\r
- LIST_ENTRY CodeSegmentList;\r
-} IMAGE_PROPERTIES_RECORD;\r
-\r
#define IMAGE_PROPERTIES_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('I','P','P','D')\r
\r
typedef struct {\r
**/\r
EFI_STATUS\r
EFIAPI\r
-CoreGetMemoryMapPropertiesTable (\r
+CoreGetMemoryMapWithSeparatedImageSection (\r
IN OUT UINTN *MemoryMapSize,\r
IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
OUT UINTN *MapKey,\r
IN UINT32 SectionAlignment\r
)\r
{\r
- if (((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) &&\r
+ if (((SectionAlignment & (RUNTIME_PAGE_ALLOCATION_GRANULARITY - 1)) != 0) &&\r
((mPropertiesTable.MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) != 0)) {\r
DEBUG ((EFI_D_VERBOSE, "SetPropertiesTableSectionAlignment - Clear\n"));\r
mPropertiesTable.MemoryProtectionAttribute &= ~((UINT64)EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA);\r
\r
@param ImageRecord image record to be sorted\r
**/\r
-STATIC\r
VOID\r
SortImageRecordCodeSection (\r
IN IMAGE_PROPERTIES_RECORD *ImageRecord\r
@retval TRUE image record is valid\r
@retval FALSE image record is invalid\r
**/\r
-STATIC\r
BOOLEAN\r
IsImageRecordCodeSectionValid (\r
IN IMAGE_PROPERTIES_RECORD *ImageRecord\r
}\r
\r
SetPropertiesTableSectionAlignment (SectionAlignment);\r
- if ((SectionAlignment & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {\r
+ if ((SectionAlignment & (RUNTIME_PAGE_ALLOCATION_GRANULARITY - 1)) != 0) {\r
DEBUG ((EFI_D_WARN, "!!!!!!!! InsertImageRecord - Section Alignment(0x%x) is not %dK !!!!!!!!\n",\r
- SectionAlignment, EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT >> 10));\r
+ SectionAlignment, RUNTIME_PAGE_ALLOCATION_GRANULARITY >> 10));\r
PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageAddress);\r
if (PdbPointer != NULL) {\r
DEBUG ((EFI_D_WARN, "!!!!!!!! Image - %a !!!!!!!!\n", PdbPointer));\r
DEBUG ((EFI_D_INFO, "MemoryProtectionAttribute - 0x%016lx\n", mPropertiesTable.MemoryProtectionAttribute));\r
if ((mPropertiesTable.MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) == 0) {\r
DEBUG ((EFI_D_ERROR, "MemoryProtectionAttribute NON_EXECUTABLE_PE_DATA is not set, "));\r
- DEBUG ((EFI_D_ERROR, "because Runtime Driver Section Alignment is not %dK.\n", EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT >> 10));\r
+ DEBUG ((EFI_D_ERROR, "because Runtime Driver Section Alignment is not %dK.\n", RUNTIME_PAGE_ALLOCATION_GRANULARITY >> 10));\r
return ;\r
}\r
\r
- gBS->GetMemoryMap = CoreGetMemoryMapPropertiesTable;\r
+ gBS->GetMemoryMap = CoreGetMemoryMapWithSeparatedImageSection;\r
gBS->Hdr.CRC32 = 0;\r
gBS->CalculateCrc32 ((UINT8 *)gBS, gBS->Hdr.HeaderSize, &gBS->Hdr.CRC32);\r
\r