]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c
Remove all blanks lines to avoid build errors.
[mirror_edk2.git] / EdkNt32Pkg / Library / EdkGenericBdsLib / Performance.c
index c7b6bc9d5d609ba96d176732cdd4c132cfdd7a11..2d157aebb3563271aef90135bd45b23fb5fabf04 100644 (file)
@@ -1,13 +1,13 @@
 /*++\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
@@ -23,17 +23,6 @@ Abstract:
 \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
@@ -44,7 +33,7 @@ GetShortPdbFileName (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
 Arguments:\r
 \r
 Returns:\r
@@ -187,13 +176,13 @@ WriteBootToOsPerformanceData (
 /*++\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
@@ -232,9 +221,10 @@ Returns:
   //\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
@@ -242,7 +232,7 @@ Returns:
     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
@@ -261,7 +251,7 @@ Returns:
                   &Cpu\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+    gBS->FreePages (mAcpiLowMemoryBase, 4);\r
     return ;\r
   }\r
   //\r
@@ -269,7 +259,7 @@ Returns:
   //\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
@@ -294,7 +284,7 @@ Returns:
                   &Handles\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePages (mAcpiLowMemoryBase, 1);\r
+    gBS->FreePages (mAcpiLowMemoryBase, 4);\r
     return ;\r
   }\r
   //\r
@@ -338,7 +328,7 @@ Returns:
     }\r
   }\r
 \r
-  gBS->FreePool (Handles);\r
+  FreePool (Handles);\r
 \r
   //\r
   // Get inserted performance data\r
@@ -373,8 +363,6 @@ Returns:
 \r
 Done:\r
 \r
-  ClearDebugRegisters ();\r
-\r
   mPerfHeader.Signiture = 0x66726550;\r
 \r
   //\r
@@ -388,7 +376,7 @@ Done:
 \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