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"
//
@@ -72,7 +72,7 @@ CoreConnectController (
//
AlignedRemainingDevicePath = NULL;
if (RemainingDevicePath != NULL) {
AlignedRemainingDevicePath = CoreDuplicateDevicePath (RemainingDevicePath);
AlignedRemainingDevicePath = DuplicateDevicePath (RemainingDevicePath);
}
//
@@ -137,7 +137,7 @@ CoreConnectController (
//
// Allocate a handle buffer for ControllerHandle's children
//
ChildHandleBuffer = CoreAllocateBootServicesPool (ChildHandleCount * sizeof(EFI_HANDLE));
ChildHandleBuffer = AllocatePool (ChildHandleCount * sizeof(EFI_HANDLE));
//
// Fill in a handle buffer with ControllerHandle's children
@@ -376,7 +376,7 @@ CoreConnectSingleController (
//
// Allocate a duplicate array for the sorted Driver Binding Protocol Instances
//
SortedDriverBindingProtocols = CoreAllocateBootServicesPool (sizeof (VOID *) * DriverBindingHandleCount);
SortedDriverBindingProtocols = AllocatePool (sizeof (VOID *) * DriverBindingHandleCount);
if (SortedDriverBindingProtocols == NULL) {
CoreFreePool (DriverBindingHandleBuffer);
return EFI_OUT_OF_RESOURCES;
@@ -707,7 +707,7 @@ CoreDisconnectController (
goto Done;
}
DriverImageHandleBuffer = CoreAllocateBootServicesPool (sizeof (EFI_HANDLE) * DriverImageHandleCount);
DriverImageHandleBuffer = AllocatePool (sizeof (EFI_HANDLE) * DriverImageHandleCount);
if (DriverImageHandleBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@@ -789,7 +789,7 @@ CoreDisconnectController (
ChildHandleValid = FALSE;
ChildBuffer = NULL;
if (ChildBufferCount != 0) {
ChildBuffer = CoreAllocateBootServicesPool (sizeof (EFI_HANDLE) * ChildBufferCount);
ChildBuffer = AllocatePool (sizeof (EFI_HANDLE) * ChildBufferCount);
if (ChildBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;