#include <Library/UefiRuntimeServicesTableLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/DebugLib.h>\r
+#include <Library/DxeServicesLib.h>\r
#include <Library/TimerLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
Buffer[ChecksumOffset] = CalculateCheckSum8 (Buffer, Size);\r
}\r
\r
-/**\r
- Allocate EfiReservedMemoryType below 4G memory address.\r
-\r
- This function allocates EfiReservedMemoryType below 4G memory address.\r
-\r
- @param[in] Size Size of memory to allocate.\r
-\r
- @return Allocated address for output.\r
-\r
-**/\r
-VOID *\r
-FpdtAllocateReservedMemoryBelow4G (\r
- IN UINTN Size\r
- )\r
-{\r
- UINTN Pages;\r
- EFI_PHYSICAL_ADDRESS Address;\r
- EFI_STATUS Status;\r
- VOID *Buffer;\r
-\r
- Buffer = NULL;\r
- Pages = EFI_SIZE_TO_PAGES (Size);\r
- Address = 0xffffffff;\r
-\r
- Status = gBS->AllocatePages (\r
- AllocateMaxAddress,\r
- EfiReservedMemoryType,\r
- Pages,\r
- &Address\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- if (!EFI_ERROR (Status)) {\r
- Buffer = (VOID *) (UINTN) Address;\r
- ZeroMem (Buffer, Size);\r
- }\r
-\r
- return Buffer;\r
-}\r
-\r
/**\r
Callback function upon VariableArchProtocol and LockBoxProtocol\r
to allocate S3 performance table memory and save the pointer to LockBox.\r
//\r
// Fail to allocate at specified address, continue to allocate at any address.\r
//\r
- mAcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) FpdtAllocateReservedMemoryBelow4G (sizeof (S3_PERFORMANCE_TABLE));\r
+ mAcpiS3PerformanceTable = (S3_PERFORMANCE_TABLE *) AllocatePeiAccessiblePages (\r
+ EfiReservedMemoryType,\r
+ EFI_SIZE_TO_PAGES (sizeof (S3_PERFORMANCE_TABLE))\r
+ );\r
}\r
DEBUG ((EFI_D_INFO, "FPDT: ACPI S3 Performance Table address = 0x%x\n", mAcpiS3PerformanceTable));\r
if (mAcpiS3PerformanceTable != NULL) {\r
//\r
// Fail to allocate at specified address, continue to allocate at any address.\r
//\r
- mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) FpdtAllocateReservedMemoryBelow4G (BootPerformanceDataSize);\r
+ mAcpiBootPerformanceTable = (BOOT_PERFORMANCE_TABLE *) AllocatePeiAccessiblePages (\r
+ EfiReservedMemoryType,\r
+ EFI_SIZE_TO_PAGES (BootPerformanceDataSize)\r
+ );\r
}\r
DEBUG ((DEBUG_INFO, "FPDT: ACPI Boot Performance Table address = 0x%x\n", mAcpiBootPerformanceTable));\r
if (mAcpiBootPerformanceTable == NULL) {\r
// Get the Boot performance table and then install it to ACPI table.\r
//\r
CopyMem (&mReceivedAcpiBootPerformanceTable, Data + 1, Data->Size);\r
+ } else if (Data != NULL && CompareGuid (&Data->Type, &gEfiFirmwarePerformanceGuid)) {\r
+ DEBUG ((DEBUG_ERROR, "FpdtStatusCodeListenerDxe: Performance data reported through gEfiFirmwarePerformanceGuid will not be collected by FirmwarePerformanceDataTableDxe\n"));\r
+ Status = EFI_UNSUPPORTED;\r
} else {\r
//\r
// Ignore else progress code.\r