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/Gcd/Gcd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'MdeModulePkg/Core/Dxe/Gcd/Gcd.c') diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 2e7afb33c3..4927c67c18 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" #define MINIMUM_INITIAL_MEMORY_SIZE 0x10000 @@ -235,12 +235,12 @@ CoreAllocateGcdMapEntry ( IN OUT EFI_GCD_MAP_ENTRY **BottomEntry ) { - *TopEntry = CoreAllocateZeroBootServicesPool (sizeof (EFI_GCD_MAP_ENTRY)); + *TopEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); if (*TopEntry == NULL) { return EFI_OUT_OF_RESOURCES; } - *BottomEntry = CoreAllocateZeroBootServicesPool (sizeof (EFI_GCD_MAP_ENTRY)); + *BottomEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY)); if (*BottomEntry == NULL) { CoreFreePool (*TopEntry); return EFI_OUT_OF_RESOURCES; @@ -1401,7 +1401,7 @@ CoreGetMemorySpaceMap ( // // Allocate the MemorySpaceMap // - *MemorySpaceMap = CoreAllocateBootServicesPool (*NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR)); + *MemorySpaceMap = AllocatePool (*NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR)); if (*MemorySpaceMap == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1649,7 +1649,7 @@ CoreGetIoSpaceMap ( // // Allocate the IoSpaceMap // - *IoSpaceMap = CoreAllocateBootServicesPool (*NumberOfDescriptors * sizeof (EFI_GCD_IO_SPACE_DESCRIPTOR)); + *IoSpaceMap = AllocatePool (*NumberOfDescriptors * sizeof (EFI_GCD_IO_SPACE_DESCRIPTOR)); if (*IoSpaceMap == NULL) { Status = EFI_OUT_OF_RESOURCES; goto Done; @@ -1983,7 +1983,7 @@ CoreInitializeGcdServices ( // // Initialize the GCD Memory Space Map // - Entry = CoreAllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdMemorySpaceMapEntryTemplate); + Entry = AllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdMemorySpaceMapEntryTemplate); ASSERT (Entry != NULL); Entry->EndAddress = LShiftU64 (1, SizeOfMemorySpace) - 1; @@ -1993,7 +1993,7 @@ CoreInitializeGcdServices ( // // Initialize the GCD I/O Space Map // - Entry = CoreAllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdIoSpaceMapEntryTemplate); + Entry = AllocateCopyPool (sizeof (EFI_GCD_MAP_ENTRY), &mGcdIoSpaceMapEntryTemplate); ASSERT (Entry != NULL); Entry->EndAddress = LShiftU64 (1, SizeOfIoSpace) - 1; @@ -2128,7 +2128,7 @@ CoreInitializeGcdServices ( // // Relocate HOB List to an allocated pool buffer. // - NewHobList = CoreAllocateCopyPool ( + NewHobList = AllocateCopyPool ( (UINTN)PhitHob->EfiFreeMemoryBottom - (UINTN)(*HobStart), *HobStart ); -- cgit v1.2.3