mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-07 19:45:07 +02:00
Ported to use BaseMemoryLib functions
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@839 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4f914125e8
commit
bc724e5885
@ -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 ();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user