diff options
author | ajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-08 14:53:17 +0000 |
---|---|---|
committer | ajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-07-08 14:53:17 +0000 |
commit | bc724e5885e7f2bfe5f4883ed9e1dc7e02874c9b (patch) | |
tree | eb57c5cd65e4a92a4a7d7310ecc908d110940c31 | |
parent | 4f914125e83bc2fa88862432b8194c4e2485189f (diff) | |
download | edk2-bc724e5885e7f2bfe5f4883ed9e1dc7e02874c9b.tar.gz edk2-bc724e5885e7f2bfe5f4883ed9e1dc7e02874c9b.tar.bz2 edk2-bc724e5885e7f2bfe5f4883ed9e1dc7e02874c9b.zip |
Ported to use BaseMemoryLib functions
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@839 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index e4e7b3bb3b..d2417234ab 100644 --- a/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/EdkModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -118,7 +118,8 @@ GetGauge ( STATIC GAUGE_DATA_HEADER *mGaugeData;
STATIC UINT32 mMaxGaugeRecords;
-PERFORMANCE_PROTOCOL PerformanceInterface = {
+EFI_HANDLE mHandle = NULL;
+PERFORMANCE_PROTOCOL mPerformanceInterface = {
StartGauge,
EndGauge,
GetGauge
@@ -223,21 +224,18 @@ StartGauge ( //
OldGaugeData = mGaugeData;
OldGaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
+
mMaxGaugeRecords *= 2;
GaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- GaugeDataSize,
- (VOID **) &mGaugeData
- );
- if (EFI_ERROR (Status)) {
- return Status;
+
+ mGaugeData = AllocateZeroPool (GaugeDataSize);
+ if (mGaugeData == NULL) {
+ return EFI_OUT_OF_MEMORY;
}
//
// Initialize new data arry and migrate old data one.
//
- mGaugeData = ZeroMem (mGaugeData, GaugeDataSize);
- mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize);
+ mGaugeData = CopyMem (mGaugeData, OldGaugeData, OldGaugeDataSize);
gBS->FreePool (OldGaugeData);
}
@@ -423,31 +421,23 @@ DxeCorePerformanceLibConstructor ( )
{
EFI_STATUS Status;
- EFI_HANDLE Handle;
- UINTN GaugeDataSize;
//
// Install the protocol interfaces.
//
Handle = NULL;
Status = gBS->InstallProtocolInterface (
- &Handle,
+ &mHandle,
&gPerformanceProtocolGuid,
EFI_NATIVE_INTERFACE,
- &PerformanceInterface
+ &mPerformanceInterface
);
ASSERT_EFI_ERROR (Status);
mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + MAX_PEI_PERFORMANCE_LOG_ENTRIES;
- GaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- GaugeDataSize,
- (VOID **) &mGaugeData
- );
- ASSERT_EFI_ERROR (Status);
- ZeroMem (mGaugeData, GaugeDataSize);
+ mGaugeData = AllocateZeroPool (sizeof (GAUGE_DATA_HEADER) + (sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords));
+ ASSERT (mGaugeData != NULL);
InternalGetPeiPerformance ();
|