performance, all the function will only include if the performance\r
switch is set.\r
\r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
All rights reserved. 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
\r
PERF_HEADER mPerfHeader;\r
PERF_DATA mPerfData;\r
+EFI_PHYSICAL_ADDRESS mAcpiLowMemoryBase = 0x0FFFFFFFFULL;\r
\r
/**\r
Get the short verion of PDB file name to be\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_PHYSICAL_ADDRESS AcpiLowMemoryBase;\r
UINT32 AcpiLowMemoryLength;\r
UINT32 LimitCount;\r
EFI_HANDLE *Handles;\r
CountUp = FALSE;\r
}\r
\r
- AcpiLowMemoryLength = 0x2000;\r
-\r
- //\r
- // Allocate a block of memory that contain performance data to OS\r
- //\r
- Status = gBS->AllocatePages (\r
- AllocateAnyPages,\r
- EfiACPIReclaimMemory,\r
- EFI_SIZE_TO_PAGES (AcpiLowMemoryLength),\r
- &AcpiLowMemoryBase\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return ;\r
- }\r
-\r
-\r
- Ptr = (UINT8 *) ((UINT32) AcpiLowMemoryBase + sizeof (PERF_HEADER));\r
- LimitCount = (AcpiLowMemoryLength - sizeof (PERF_HEADER)) / sizeof (PERF_DATA);\r
-\r
//\r
// Put Detailed performance data into memory\r
//\r
&Handles\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePages (AcpiLowMemoryBase, 1);\r
return ;\r
}\r
+\r
+\r
+ AcpiLowMemoryLength = 0x4000;\r
+ if (mAcpiLowMemoryBase == 0x0FFFFFFFF) {\r
+ //\r
+ // Allocate a block of memory that contain performance data to OS\r
+ //\r
+ Status = gBS->AllocatePages (\r
+ AllocateMaxAddress,\r
+ EfiReservedMemoryType,\r
+ EFI_SIZE_TO_PAGES (AcpiLowMemoryLength),\r
+ &mAcpiLowMemoryBase\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ FreePool (Handles);\r
+ return ;\r
+ }\r
+ }\r
+\r
+\r
+ Ptr = (UINT8 *) ((UINT32) mAcpiLowMemoryBase + sizeof (PERF_HEADER));\r
+ LimitCount = (AcpiLowMemoryLength - sizeof (PERF_HEADER)) / sizeof (PERF_DATA);\r
+\r
+\r
\r
//\r
// Get DXE drivers performance\r
mPerfHeader.Signiture = PERFORMANCE_SIGNATURE;\r
\r
//\r
- // Put performance data to ACPI memory\r
+ // Put performance data to Reserved memory\r
//\r
CopyMem (\r
- (UINTN *) (UINTN) AcpiLowMemoryBase,\r
+ (UINTN *) (UINTN) mAcpiLowMemoryBase,\r
&mPerfHeader,\r
sizeof (PERF_HEADER)\r
);\r
&gPerformanceProtocolGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
sizeof (EFI_PHYSICAL_ADDRESS),\r
- &AcpiLowMemoryBase\r
+ &mAcpiLowMemoryBase\r
);\r
\r
return ;\r