From 2c3b5ec562c7b43a73424e1be25e2053d1edfe4f Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 14 Mar 2007 02:02:43 +0000 Subject: Clean up the gBS sevice (CopyMem, SetMem, AllocatePool, FreePool) with the corresponding APIs defined in Mde library class for these modules. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2456 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h | 2 +- .../Universal/DevicePath/Dxe/DevicePath.msa | 24 ++++++++++------------ .../Universal/DevicePath/Dxe/DevicePathFromText.c | 16 +++++++-------- .../Universal/DevicePath/Dxe/DevicePathToText.c | 6 +++--- 4 files changed, 23 insertions(+), 25 deletions(-) (limited to 'EdkModulePkg/Universal/DevicePath') diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h index f74a65c48b..d7311aa00a 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.h @@ -11,7 +11,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: - DevicePathDriver.h + DevicePath.h Abstract: Definition for Device Path Utilities driver diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa index 541c01482d..bd082809e3 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.msa @@ -6,8 +6,9 @@ 9B680FCE-AD6B-4F3A-B60B-F59899003443 1.0 Component description file for Device Path Driver. - This driver is for DevicePathUtilities, DevicePahtToText and DevicePathFromText - Copyright (c) 2006, Intel Corporation + This driver implement these three UEFI deveice path protocols ( + DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them. + Copyright (c) 2006 - 2007, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -22,18 +23,17 @@ DevicePath - + DebugLib + Recommended libary Instance is PeiDxeDebugLibReportStatusCode instance in MdePkg. - + PrintLib + Recommended libary Instance is BasePrintLib instance in MdePkg. UefiDriverEntryPoint - - UefiLib - BaseLib @@ -46,8 +46,9 @@ UefiBootServicesTableLib - + DevicePathLib + Recommended libary Instance is UefiDevicePathLib instance in MdePkg. PcdLib @@ -68,9 +69,6 @@ gEfiDebugPortProtocolGuid - - gEfiDevicePathProtocolGuid - gEfiDevicePathUtilitiesProtocolGuid @@ -103,13 +101,13 @@ - + PcdDevicePathSupportDevicePathToText gEfiEdkModulePkgTokenSpaceGuid FALSE If TRUE, then the Device Path To Text Protocol should be produced by the platform - + PcdDevicePathSupportDevicePathFromText gEfiEdkModulePkgTokenSpaceGuid FALSE diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c index 3014b200ac..94a4a2b5b7 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c @@ -2277,10 +2277,10 @@ ConvertTextToDeviceNode ( DeviceNode = DumpNode (DeviceNodeStr); } else { DeviceNode = DumpNode (ParamStr); - gBS->FreePool (ParamStr); + FreePool (ParamStr); } - gBS->FreePool (DeviceNodeStr); + FreePool (DeviceNodeStr); return DeviceNode; } @@ -2346,12 +2346,12 @@ ConvertTextToDevicePath ( DeviceNode = DumpNode (DeviceNodeStr); } else { DeviceNode = DumpNode (ParamStr); - gBS->FreePool (ParamStr); + FreePool (ParamStr); } NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); - gBS->FreePool (DevicePath); - gBS->FreePool (DeviceNode); + FreePool (DevicePath); + FreePool (DeviceNode); DevicePath = NewDevicePath; if (IsInstanceEnd) { @@ -2359,12 +2359,12 @@ ConvertTextToDevicePath ( SetDevicePathInstanceEndNode (DeviceNode); NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); - gBS->FreePool (DevicePath); - gBS->FreePool (DeviceNode); + FreePool (DevicePath); + FreePool (DeviceNode); DevicePath = NewDevicePath; } } - gBS->FreePool (DevicePathStr); + FreePool (DevicePathStr); return DevicePath; } diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c index 03150706c7..f1365baa26 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathToText.c @@ -132,7 +132,7 @@ ReallocatePool ( CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize); } - gBS->FreePool (OldPool); + FreePool (OldPool); } return NewPool; @@ -196,7 +196,7 @@ CatPrint ( Str->Len = Size - sizeof (UINT16); } - gBS->FreePool (AppendStr); + FreePool (AppendStr); return Str->Str; } @@ -1488,7 +1488,7 @@ ConvertDevicePathToText ( // // Shrink pool used for string allocation // - gBS->FreePool (UnpackDevPath); + FreePool (UnpackDevPath); NewSize = (Str.Len + 1) * sizeof (CHAR16); Str.Str = ReallocatePool (Str.Str, NewSize, NewSize); -- cgit v1.2.3