X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkNt32Pkg%2FLibrary%2FEdkGenericBdsLib%2FPerformance.c;h=2d157aebb3563271aef90135bd45b23fb5fabf04;hp=c7b6bc9d5d609ba96d176732cdd4c132cfdd7a11;hb=f5bd465ba304173d98e3ff38503b54b1b826a2a7;hpb=2ce311322c72857f73138c45358e722607a1e80c diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c index c7b6bc9d5d..2d157aebb3 100644 --- a/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c +++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c @@ -1,13 +1,13 @@ /*++ -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +Copyright (c) 2006 - 2007, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: @@ -23,17 +23,6 @@ Abstract: #include "Performance.h" -VOID -ClearDebugRegisters ( - VOID - ) -{ - // - // BugBug: We should not need to do this. We need to root cause this bug!!!! - // - AsmWriteDr0 (0); - AsmWriteDr1 (0); -} STATIC VOID @@ -44,7 +33,7 @@ GetShortPdbFileName ( /*++ Routine Description: - + Arguments: Returns: @@ -187,13 +176,13 @@ WriteBootToOsPerformanceData ( /*++ Routine Description: - + Allocates a block of memory and writes performance data of booting to OS into it. Arguments: - + None - + Returns: None @@ -232,9 +221,10 @@ Returns: // // Allocate a block of memory that contain performance data to OS // + mAcpiLowMemoryBase = 0xFFFFFFFF; Status = gBS->AllocatePages ( - AllocateAnyPages, - EfiACPIReclaimMemory, + AllocateMaxAddress, + EfiReservedMemoryType, 4, &mAcpiLowMemoryBase ); @@ -242,7 +232,7 @@ Returns: return ; } - mAcpiLowMemoryLength = 0x1000; + mAcpiLowMemoryLength = EFI_PAGES_TO_SIZE(4); Ptr = (UINT8 *) ((UINT32) mAcpiLowMemoryBase + sizeof (PERF_HEADER)); LimitCount = (mAcpiLowMemoryLength - sizeof (PERF_HEADER)) / sizeof (PERF_DATA); @@ -261,7 +251,7 @@ Returns: &Cpu ); if (EFI_ERROR (Status)) { - gBS->FreePages (mAcpiLowMemoryBase, 1); + gBS->FreePages (mAcpiLowMemoryBase, 4); return ; } // @@ -269,7 +259,7 @@ Returns: // Status = Cpu->GetTimerValue (Cpu, 0, &(CurrentTicker), &TimerPeriod); if (EFI_ERROR (Status)) { - gBS->FreePages (mAcpiLowMemoryBase, 1); + gBS->FreePages (mAcpiLowMemoryBase, 4); return ; } @@ -294,7 +284,7 @@ Returns: &Handles ); if (EFI_ERROR (Status)) { - gBS->FreePages (mAcpiLowMemoryBase, 1); + gBS->FreePages (mAcpiLowMemoryBase, 4); return ; } // @@ -338,7 +328,7 @@ Returns: } } - gBS->FreePool (Handles); + FreePool (Handles); // // Get inserted performance data @@ -373,8 +363,6 @@ Returns: Done: - ClearDebugRegisters (); - mPerfHeader.Signiture = 0x66726550; // @@ -388,7 +376,7 @@ Done: gRT->SetVariable ( L"PerfDataMemAddr", - &gEfiGlobalVariableGuid, + &gEfiGenericPlatformVariableGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof (UINT32), (VOID *) &mAcpiLowMemoryBase