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:
qhuang8
2008-08-27 14:29:23 +00:00
parent fb53e6cc34
commit 9c4ac31cca
31 changed files with 92 additions and 559 deletions

View File

@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <DxeMain.h>
#include "DxeMain.h"
/**
@@ -177,7 +177,7 @@ CoreOpenImageFile (
// Because the device path consists of one or more FILE PATH MEDIA DEVICE PATH
// nodes, It assures the fields in device path nodes are 2 byte aligned.
//
FilePathNode = (FILEPATH_DEVICE_PATH *)CoreDuplicateDevicePath((EFI_DEVICE_PATH_PROTOCOL *)(UINTN)FilePathNode);
FilePathNode = (FILEPATH_DEVICE_PATH *)DuplicateDevicePath((EFI_DEVICE_PATH_PROTOCOL *)(UINTN)FilePathNode);
if (FilePathNode == NULL) {
FileHandle->Close (FileHandle);
Status = EFI_OUT_OF_RESOURCES;
@@ -247,7 +247,7 @@ CoreOpenImageFile (
//
// Allocate space for the file
//
ImageFileHandle->Source = CoreAllocateBootServicesPool ((UINTN)FileInfo->FileSize);
ImageFileHandle->Source = AllocatePool ((UINTN)FileInfo->FileSize);
if (ImageFileHandle->Source != NULL) {
//
// Read the file into the buffer we allocated
@@ -453,7 +453,7 @@ CoreGrowBuffer (
CoreFreePool (*Buffer);
}
*Buffer = CoreAllocateBootServicesPool (BufferSize);
*Buffer = AllocatePool (BufferSize);
if (*Buffer != NULL) {
TryAgain = TRUE;
} else {