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/Misc/DebugImageInfo.c | 6 ++-- .../Core/Dxe/Misc/InstallConfigurationTable.c | 38 ++-------------------- MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c | 2 +- MdeModulePkg/Core/Dxe/Misc/Stall.c | 2 +- 4 files changed, 7 insertions(+), 41 deletions(-) (limited to 'MdeModulePkg/Core/Dxe/Misc') diff --git a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c index 78f5073e3b..50e4468399 100644 --- a/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c +++ b/MdeModulePkg/Core/Dxe/Misc/DebugImageInfo.c @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" EFI_DEBUG_IMAGE_INFO_TABLE_HEADER mDebugInfoTableHeader = { @@ -152,7 +152,7 @@ CoreNewDebugImageInfoEntry ( // Table is full, so re-allocate another page for a larger table... // TableSize = MaxTableIndex * EFI_DEBUG_TABLE_ENTRY_SIZE; - NewTable = CoreAllocateZeroBootServicesPool (TableSize + EFI_PAGE_SIZE); + NewTable = AllocateZeroPool (TableSize + EFI_PAGE_SIZE); if (NewTable == NULL) { mDebugInfoTableHeader.UpdateStatus &= ~EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS; return; @@ -175,7 +175,7 @@ CoreNewDebugImageInfoEntry ( // // Allocate data for new entry // - Table[Index].NormalImage = CoreAllocateZeroBootServicesPool (sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL)); + Table[Index].NormalImage = AllocateZeroPool (sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL)); if (Table[Index].NormalImage != NULL) { // // Update the entry diff --git a/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c b/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c index 4eed6523b3..34dc532752 100644 --- a/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c +++ b/MdeModulePkg/Core/Dxe/Misc/InstallConfigurationTable.c @@ -12,46 +12,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" #define CONFIG_TABLE_SIZE_INCREASED 0x10 UINTN mSystemTableAllocateSize = 0; - - -/** - Find a config table by name in system table's ConfigurationTable. - - @param Guid The table name to look for - @param Table Pointer of the config table - - @retval EFI_NOT_FOUND Could not find the table in system table's - ConfigurationTable. - @retval EFI_SUCCESS Table successfully found. - -**/ -EFI_STATUS -CoreGetConfigTable ( - IN EFI_GUID *Guid, - OUT VOID **Table - ) -{ - UINTN Index; - - for (Index = 0; Index < gDxeCoreST->NumberOfTableEntries; Index++) { - if (CompareGuid (Guid, &(gDxeCoreST->ConfigurationTable[Index].VendorGuid))) { - *Table = gDxeCoreST->ConfigurationTable[Index].VendorTable; - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - - - - /** Boot Service called to add, modify, or remove a system configuration table from the EFI System Table. @@ -149,7 +115,7 @@ CoreInstallConfigurationTable ( // Allocate a table with one additional entry. // mSystemTableAllocateSize += (CONFIG_TABLE_SIZE_INCREASED * sizeof (EFI_CONFIGURATION_TABLE)); - EfiConfigurationTable = CoreAllocateRuntimePool (mSystemTableAllocateSize); + EfiConfigurationTable = AllocateRuntimePool (mSystemTableAllocateSize); if (EfiConfigurationTable == NULL) { // // If a new table could not be allocated, then return an error. diff --git a/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c b/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c index c7798133b1..6465f2a514 100644 --- a/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c +++ b/MdeModulePkg/Core/Dxe/Misc/SetWatchdogTimer.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include "DxeMain.h" #define WATCHDOG_TIMER_CALIBRATE_PER_SECOND 10000000 diff --git a/MdeModulePkg/Core/Dxe/Misc/Stall.c b/MdeModulePkg/Core/Dxe/Misc/Stall.c index 5608db0148..96d9b339cf 100644 --- a/MdeModulePkg/Core/Dxe/Misc/Stall.c +++ b/MdeModulePkg/Core/Dxe/Misc/Stall.c @@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Include statements // -#include +#include "DxeMain.h" -- cgit v1.2.3