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 <DxeMain.h> 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
This commit is contained in:
@@ -14,7 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <DxeMain.h>
|
||||
#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
|
||||
);
|
||||
|
Reference in New Issue
Block a user