From 9c4ac31cca01b4a503c36616770ea3157bf3bb9e Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 27 Aug 2008 14:29:23 +0000 Subject: Clean up DxeCore to remove duplicate memory allocation & device path utility services in Library.c.DxeCore should use MemoryAllocationLib & DevicePathLib for these API. Minor cleanup the coding style: #include should be changed to #include "DxeMain.h" since "DxeMain.h" is not pubic header fie. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5742 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c | 6 +++--- MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'MdeModulePkg/Core/Dxe/Dispatcher') diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c index f4a448680f..e489547302 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c @@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" // // Global stack used to evaluate dependency expressions @@ -50,7 +50,7 @@ GrowDepexStack ( Size = Size + (mDepexEvaluationStackEnd - mDepexEvaluationStack); } - NewStack = CoreAllocateBootServicesPool (Size * sizeof (BOOLEAN)); + NewStack = AllocatePool (Size * sizeof (BOOLEAN)); if (NewStack == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -68,7 +68,7 @@ GrowDepexStack ( // // Free The Old Stack // - CoreFreePool (mDepexEvaluationStack); + FreePool (mDepexEvaluationStack); } // diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c index f00442684e..ba8734e1d6 100644 --- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c @@ -37,7 +37,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" // // The Driver List contains one copy of every driver that has been discovered. @@ -638,7 +638,7 @@ FvIsBeingProcesssed ( { KNOWN_HANDLE *KnownHandle; - KnownHandle = CoreAllocateBootServicesPool (sizeof (KNOWN_HANDLE)); + KnownHandle = AllocatePool (sizeof (KNOWN_HANDLE)); ASSERT (KnownHandle != NULL); KnownHandle->Signature = KNOWN_HANDLE_SIGNATURE; @@ -688,7 +688,7 @@ CoreFvToDevicePath ( mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL)); - FileNameDevicePath = CoreAppendDevicePath ( + FileNameDevicePath = AppendDevicePath ( FvDevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath ); @@ -733,7 +733,7 @@ CoreAddToDriverList ( // Create the Driver Entry for the list. ZeroPool initializes lots of variables to // NULL or FALSE. // - DriverEntry = CoreAllocateZeroBootServicesPool (sizeof (EFI_CORE_DRIVER_ENTRY)); + DriverEntry = AllocateZeroPool (sizeof (EFI_CORE_DRIVER_ENTRY)); ASSERT (DriverEntry != NULL); DriverEntry->Signature = EFI_CORE_DRIVER_ENTRY_SIGNATURE; @@ -876,7 +876,7 @@ CoreProcessFvImageFile ( // ReadSection or Produce FVB failed, Free data buffer // if (Buffer != NULL) { - CoreFreePool (Buffer); + FreePool (Buffer); } if (AlignedBuffer != NULL) { @@ -1043,7 +1043,7 @@ CoreFwVolEventProtocolNotify ( mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL)); - gDxeCoreLoadedImage->FilePath = CoreDuplicateDevicePath ( + gDxeCoreLoadedImage->FilePath = DuplicateDevicePath ( (EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath ); gDxeCoreLoadedImage->DeviceHandle = FvHandle; -- cgit v1.2.3