/*++\r
\r
-Copyright (c) 2006, Intel Corporation \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
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006 - 2007, Intel Corporation\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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
\r
#include "Performance.h"\r
\r
-VOID\r
-ClearDebugRegisters (\r
- VOID\r
- )\r
-{\r
- //\r
- // BugBug: We should not need to do this. We need to root cause this bug!!!!\r
- //\r
- AsmWriteDr0 (0);\r
- AsmWriteDr1 (0);\r
-}\r
\r
STATIC\r
VOID\r
/*++\r
\r
Routine Description:\r
- \r
+\r
Arguments:\r
\r
Returns:\r
/*++\r
\r
Routine Description:\r
- \r
+\r
Allocates a block of memory and writes performance data of booting to OS into it.\r
\r
Arguments:\r
- \r
+\r
None\r
- \r
+\r
Returns:\r
\r
None\r
//\r
// Allocate a block of memory that contain performance data to OS\r
//\r
+ mAcpiLowMemoryBase = 0xFFFFFFFF;\r
Status = gBS->AllocatePages (\r
- AllocateAnyPages,\r
- EfiACPIReclaimMemory,\r
+ AllocateMaxAddress,\r
+ EfiReservedMemoryType,\r
4,\r
&mAcpiLowMemoryBase\r
);\r
return ;\r
}\r
\r
- mAcpiLowMemoryLength = 0x1000;\r
+ mAcpiLowMemoryLength = EFI_PAGES_TO_SIZE(4);\r
\r
Ptr = (UINT8 *) ((UINT32) mAcpiLowMemoryBase + sizeof (PERF_HEADER));\r
LimitCount = (mAcpiLowMemoryLength - sizeof (PERF_HEADER)) / sizeof (PERF_DATA);\r
&Cpu\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+ gBS->FreePages (mAcpiLowMemoryBase, 4);\r
return ;\r
}\r
//\r
//\r
Status = Cpu->GetTimerValue (Cpu, 0, &(CurrentTicker), &TimerPeriod);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+ gBS->FreePages (mAcpiLowMemoryBase, 4);\r
return ;\r
}\r
\r
&Handles\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+ gBS->FreePages (mAcpiLowMemoryBase, 4);\r
return ;\r
}\r
//\r
}\r
}\r
\r
- gBS->FreePool (Handles);\r
+ FreePool (Handles);\r
\r
//\r
// Get inserted performance data\r
\r
Done:\r
\r
- ClearDebugRegisters ();\r
-\r
mPerfHeader.Signiture = 0x66726550;\r
\r
//\r
\r
gRT->SetVariable (\r
L"PerfDataMemAddr",\r
- &gEfiGlobalVariableGuid,\r
+ &gEfiGenericPlatformVariableGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
sizeof (UINT32),\r
(VOID *) &mAcpiLowMemoryBase\r