///\r
#define DEPEX_STACK_SIZE_INCREMENT 0x1000\r
\r
-#if defined (MDE_CPU_IPF)\r
-///\r
-/// For Itanium machines make the default allocations 8K aligned\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE * 2)\r
-#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE * 2)\r
-\r
-#elif defined (MDE_CPU_AARCH64)\r
-///\r
-/// 64-bit ARM systems allow the OS to execute with 64 KB page size,\r
-/// so for improved interoperability with the firmware, align the\r
-/// runtime regions to 64 KB as well\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (SIZE_64KB)\r
-#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE)\r
-\r
-#else\r
-///\r
-/// For generic EFI machines make the default allocations 4K aligned\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)\r
-#define DEFAULT_PAGE_ALLOCATION (EFI_PAGE_SIZE)\r
-\r
-#endif\r
-\r
typedef struct {\r
EFI_GUID *ProtocolGuid;\r
VOID **Protocol;\r
#include "DxeMain.h"\r
#include "Imem.h"\r
\r
-#define EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)\r
-\r
//\r
// Entry for tracking the memory regions for each memory type to coalesce similar memory types\r
//\r
//\r
// The list is empty, to allocate one page to refuel the list\r
//\r
- FreeDescriptorEntries = CoreAllocatePoolPages (EfiBootServicesData, EFI_SIZE_TO_PAGES(DEFAULT_PAGE_ALLOCATION), DEFAULT_PAGE_ALLOCATION);\r
- if(FreeDescriptorEntries != NULL) {\r
+ FreeDescriptorEntries = CoreAllocatePoolPages (EfiBootServicesData,\r
+ EFI_SIZE_TO_PAGES (DEFAULT_PAGE_ALLOCATION_GRANULARITY),\r
+ DEFAULT_PAGE_ALLOCATION_GRANULARITY);\r
+ if (FreeDescriptorEntries != NULL) {\r
//\r
// Enque the free memmory map entries into the list\r
//\r
- for (Index = 0; Index< DEFAULT_PAGE_ALLOCATION / sizeof(MEMORY_MAP); Index++) {\r
+ for (Index = 0; Index < DEFAULT_PAGE_ALLOCATION_GRANULARITY / sizeof(MEMORY_MAP); Index++) {\r
FreeDescriptorEntries[Index].Signature = MEMORY_MAP_SIGNATURE;\r
InsertTailList (&mFreeMemoryMapEntryList, &FreeDescriptorEntries[Index].Link);\r
}\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- Alignment = EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT;\r
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;\r
\r
if (MemoryType == EfiACPIReclaimMemory ||\r
MemoryType == EfiACPIMemoryNVS ||\r
MemoryType == EfiRuntimeServicesCode ||\r
MemoryType == EfiRuntimeServicesData) {\r
\r
- Alignment = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
}\r
\r
if (Type == AllocateAddress) {\r
goto Done;\r
}\r
\r
- Alignment = EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT;\r
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;\r
\r
ASSERT (Entry != NULL);\r
if (Entry->Type == EfiACPIReclaimMemory ||\r
Entry->Type == EfiRuntimeServicesCode ||\r
Entry->Type == EfiRuntimeServicesData) {\r
\r
- Alignment = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
\r
}\r
\r
if (mMemoryTypeStatistics[Entry->Type].Runtime) {\r
ASSERT (Entry->Type != EfiACPIReclaimMemory);\r
ASSERT (Entry->Type != EfiACPIMemoryNVS);\r
- if ((Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {\r
+ if ((Entry->Start & (RUNTIME_PAGE_ALLOCATION_GRANULARITY - 1)) != 0) {\r
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));\r
Status = EFI_INVALID_PARAMETER;\r
goto Done;\r
}\r
- if (((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {\r
+ if (((Entry->End + 1) & (RUNTIME_PAGE_ALLOCATION_GRANULARITY - 1)) != 0) {\r
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));\r
Status = EFI_INVALID_PARAMETER;\r
goto Done;\r
PoolType == EfiRuntimeServicesCode ||\r
PoolType == EfiRuntimeServicesData) {\r
\r
- Granularity = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+ Granularity = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
} else {\r
- Granularity = DEFAULT_PAGE_ALLOCATION;\r
+ Granularity = DEFAULT_PAGE_ALLOCATION_GRANULARITY;\r
}\r
\r
//\r
Head->Type == EfiRuntimeServicesCode ||\r
Head->Type == EfiRuntimeServicesData) {\r
\r
- Granularity = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+ Granularity = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
} else {\r
- Granularity = DEFAULT_PAGE_ALLOCATION;\r
+ Granularity = DEFAULT_PAGE_ALLOCATION_GRANULARITY;\r
}\r
\r
if (PoolType != NULL) {\r
\r
if ((mPropertiesTable.MemoryProtectionAttribute & EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) == 0) {\r
DEBUG ((EFI_D_VERBOSE, "MemoryProtectionAttribute NON_EXECUTABLE_PE_DATA is not set, "));\r
- DEBUG ((EFI_D_VERBOSE, "because Runtime Driver Section Alignment is not %dK.\n", EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT >> 10));\r
+ DEBUG ((EFI_D_VERBOSE, "because Runtime Driver Section Alignment is not %dK.\n", RUNTIME_PAGE_ALLOCATION_GRANULARITY >> 10));\r
return ;\r
}\r
\r
switch (MemoryType) {\r
case EfiRuntimeServicesCode:\r
case EfiACPIMemoryNVS:\r
- PageAlignment = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+ PageAlignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
break;\r
case EfiRuntimeServicesData:\r
case EfiACPIReclaimMemory:\r
ASSERT (FALSE);\r
- PageAlignment = EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT;\r
+ PageAlignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;\r
break;\r
case EfiBootServicesCode:\r
case EfiLoaderCode:\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
\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