summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Dxe/Hand
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-27 14:29:23 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-27 14:29:23 +0000
commit9c4ac31cca01b4a503c36616770ea3157bf3bb9e (patch)
tree2da9349c7a4a732e3ebc27981a095b1db3146f35 /MdeModulePkg/Core/Dxe/Hand
parentfb53e6cc348e96709da625a2334faeabd4f31523 (diff)
downloadedk2-9c4ac31cca01b4a503c36616770ea3157bf3bb9e.zip
edk2-9c4ac31cca01b4a503c36616770ea3157bf3bb9e.tar.gz
edk2-9c4ac31cca01b4a503c36616770ea3157bf3bb9e.tar.bz2
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
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Hand')
-rw-r--r--MdeModulePkg/Core/Dxe/Hand/DriverSupport.c12
-rw-r--r--MdeModulePkg/Core/Dxe/Hand/Handle.c16
-rw-r--r--MdeModulePkg/Core/Dxe/Hand/Locate.c10
-rw-r--r--MdeModulePkg/Core/Dxe/Hand/Notify.c4
4 files changed, 21 insertions, 21 deletions
diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c
index 7731652..9db124c 100644
--- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c
+++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c
@@ -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;
diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c
index d94fdde..cfa103c 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include <DxeMain.h>
+#include "DxeMain.h"
//
@@ -132,7 +132,7 @@ CoreFindProtocolEntry (
// allocate a new entry
//
if ((ProtEntry == NULL) && Create) {
- ProtEntry = CoreAllocateBootServicesPool (sizeof(PROTOCOL_ENTRY));
+ ProtEntry = AllocatePool (sizeof(PROTOCOL_ENTRY));
if (ProtEntry != NULL) {
//
@@ -393,7 +393,7 @@ CoreInstallProtocolInterfaceNotify (
//
// Allocate a new protocol interface structure
//
- Prot = CoreAllocateZeroBootServicesPool (sizeof(PROTOCOL_INTERFACE));
+ Prot = AllocateZeroPool (sizeof(PROTOCOL_INTERFACE));
if (Prot == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@@ -404,7 +404,7 @@ CoreInstallProtocolInterfaceNotify (
//
Handle = (IHANDLE *)*UserHandle;
if (Handle == NULL) {
- Handle = CoreAllocateZeroBootServicesPool (sizeof(IHANDLE));
+ Handle = AllocateZeroPool (sizeof(IHANDLE));
if (Handle == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@@ -1145,7 +1145,7 @@ CoreOpenProtocol (
//
// Create new entry
//
- OpenData = CoreAllocateBootServicesPool (sizeof(OPEN_PROTOCOL_DATA));
+ OpenData = AllocatePool (sizeof(OPEN_PROTOCOL_DATA));
if (OpenData == NULL) {
Status = EFI_OUT_OF_RESOURCES;
} else {
@@ -1331,7 +1331,7 @@ CoreOpenProtocolInformation (
Size = Count * sizeof(EFI_OPEN_PROTOCOL_INFORMATION_ENTRY);
}
- Buffer = CoreAllocateBootServicesPool (Size);
+ Buffer = AllocatePool (Size);
if (Buffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@@ -1434,7 +1434,7 @@ CoreProtocolsPerHandle (
goto Done;
}
- Buffer = CoreAllocateBootServicesPool (sizeof (EFI_GUID *) * ProtocolCount);
+ Buffer = AllocatePool (sizeof (EFI_GUID *) * ProtocolCount);
if (Buffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@@ -1505,7 +1505,7 @@ CoreConnectHandlesByKey (
}
}
- HandleBuffer = CoreAllocateBootServicesPool (Count * sizeof (EFI_HANDLE));
+ HandleBuffer = AllocatePool (Count * sizeof (EFI_HANDLE));
if (HandleBuffer == NULL) {
CoreReleaseProtocolLock ();
return;
diff --git a/MdeModulePkg/Core/Dxe/Hand/Locate.c b/MdeModulePkg/Core/Dxe/Hand/Locate.c
index 3bed845..24f6e78 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Locate.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Locate.c
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include <DxeMain.h>
+#include "DxeMain.h"
//
// ProtocolRequest - Last LocateHandle request ID
@@ -450,12 +450,12 @@ CoreLocateDevicePath (
*Device = NULL_HANDLE;
SourcePath = *DevicePath;
- SourceSize = CoreDevicePathSize (SourcePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
+ SourceSize = GetDevicePathSize (SourcePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
//
// The source path can only have 1 instance
//
- if (CoreIsDevicePathMultiInstance (SourcePath)) {
+ if (IsDevicePathMultiInstance (SourcePath)) {
DEBUG((DEBUG_ERROR, "LocateDevicePath: Device path has too many instances\n"));
return EFI_INVALID_PARAMETER;
}
@@ -482,7 +482,7 @@ CoreLocateDevicePath (
//
// Check if DevicePath is first part of SourcePath
//
- Size = CoreDevicePathSize (TmpDevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
+ Size = GetDevicePathSize (TmpDevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
if ((Size <= SourceSize) && CompareMem (SourcePath, TmpDevicePath, Size) == 0) {
//
// If the size is equal to the best match, then we
@@ -672,7 +672,7 @@ CoreLocateHandleBuffer (
return Status;
}
- *Buffer = CoreAllocateBootServicesPool (BufferSize);
+ *Buffer = AllocatePool (BufferSize);
if (*Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c b/MdeModulePkg/Core/Dxe/Hand/Notify.c
index db3dfa1..5f4ae19 100644
--- a/MdeModulePkg/Core/Dxe/Hand/Notify.c
+++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include <DxeMain.h>
+#include "DxeMain.h"
/**
@@ -132,7 +132,7 @@ CoreRegisterProtocolNotify (
//
// Allocate a new notification record
//
- ProtNotify = CoreAllocateBootServicesPool (sizeof(PROTOCOL_NOTIFY));
+ ProtNotify = AllocatePool (sizeof(PROTOCOL_NOTIFY));
if (ProtNotify != NULL) {
ProtNotify->Signature = PROTOCOL_NOTIFY_SIGNATURE;