mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04: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 GAUGE_DATA_HEADER *mGaugeData;
|
||||||
STATIC UINT32 mMaxGaugeRecords;
|
STATIC UINT32 mMaxGaugeRecords;
|
||||||
|
|
||||||
PERFORMANCE_PROTOCOL PerformanceInterface = {
|
EFI_HANDLE mHandle = NULL;
|
||||||
|
PERFORMANCE_PROTOCOL mPerformanceInterface = {
|
||||||
StartGauge,
|
StartGauge,
|
||||||
EndGauge,
|
EndGauge,
|
||||||
GetGauge
|
GetGauge
|
||||||
@ -223,21 +224,18 @@ StartGauge (
|
|||||||
//
|
//
|
||||||
OldGaugeData = mGaugeData;
|
OldGaugeData = mGaugeData;
|
||||||
OldGaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
|
OldGaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
|
||||||
|
|
||||||
mMaxGaugeRecords *= 2;
|
mMaxGaugeRecords *= 2;
|
||||||
GaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
|
GaugeDataSize = sizeof (GAUGE_DATA_HEADER) + sizeof (GAUGE_DATA_ENTRY) * mMaxGaugeRecords;
|
||||||
Status = gBS->AllocatePool (
|
|
||||||
EfiBootServicesData,
|
mGaugeData = AllocateZeroPool (GaugeDataSize);
|
||||||
GaugeDataSize,
|
if (mGaugeData == NULL) {
|
||||||
(VOID **) &mGaugeData
|
return EFI_OUT_OF_MEMORY;
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Initialize new data arry and migrate old data one.
|
// 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);
|
gBS->FreePool (OldGaugeData);
|
||||||
}
|
}
|
||||||
@ -423,31 +421,23 @@ DxeCorePerformanceLibConstructor (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_HANDLE Handle;
|
|
||||||
UINTN GaugeDataSize;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install the protocol interfaces.
|
// Install the protocol interfaces.
|
||||||
//
|
//
|
||||||
Handle = NULL;
|
Handle = NULL;
|
||||||
Status = gBS->InstallProtocolInterface (
|
Status = gBS->InstallProtocolInterface (
|
||||||
&Handle,
|
&mHandle,
|
||||||
&gPerformanceProtocolGuid,
|
&gPerformanceProtocolGuid,
|
||||||
EFI_NATIVE_INTERFACE,
|
EFI_NATIVE_INTERFACE,
|
||||||
&PerformanceInterface
|
&mPerformanceInterface
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
mMaxGaugeRecords = INIT_DXE_GAUGE_DATA_ENTRIES + MAX_PEI_PERFORMANCE_LOG_ENTRIES;
|
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 ();
|
InternalGetPeiPerformance ();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user