summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/GenericBdsLib/DevicePath.c
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-22 04:17:51 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-22 04:17:51 +0000
commitec8cd35c80fa0b5d9cf249754780f6f3d3809160 (patch)
treea02ea9d3106ecbb200b401f684fcfc96ca31e0fa /MdeModulePkg/Library/GenericBdsLib/DevicePath.c
parentd0b494edf2d232a6a4569ae304f3a78f4d54cdfd (diff)
downloadedk2-ec8cd35c80fa0b5d9cf249754780f6f3d3809160.zip
edk2-ec8cd35c80fa0b5d9cf249754780f6f3d3809160.tar.gz
edk2-ec8cd35c80fa0b5d9cf249754780f6f3d3809160.tar.bz2
Code scrub for GenericBdsLib
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5545 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/GenericBdsLib/DevicePath.c')
-rw-r--r--MdeModulePkg/Library/GenericBdsLib/DevicePath.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c
index fc6d420..7435d54 100644
--- a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c
+++ b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c
@@ -15,17 +15,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "InternalBdsLib.h"
-
-EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;
-
-EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;
-
-
/**
Adjusts the size of a previously allocated buffer.
-
@param OldPool A pointer to the buffer whose size is being adjusted.
@param OldSize The size of the current buffer.
@param NewSize The size of the new buffer.
@@ -52,13 +45,12 @@ ReallocatePool (
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
}
- gBS->FreePool (OldPool);
+ SafeFreePool (OldPool);
}
return NewPool;
}
-
/**
Concatenates a formatted unicode string to allocated pool.
The caller must free the resulting buffer.
@@ -116,7 +108,7 @@ CatPrint (
Str->len = StringSize - sizeof (UINT16);
}
- gBS->FreePool (AppendStr);
+ SafeFreePool (AppendStr);
return Str->str;
}
@@ -314,22 +306,6 @@ DevPathVendor (
switch (DevicePathType (&Vendor->Header)) {
case HARDWARE_DEVICE_PATH:
Type = L"Hw";
-// bugbug: nt 32 specific definition
-#if 0
- //
- // If the device is a winntbus device, we will give it a readable device name.
- //
- if (CompareGuid (&Vendor->Guid, &mEfiWinNtThunkProtocolGuid)) {
- CatPrint (Str, L"%s", L"WinNtBus");
- return ;
- } else if (CompareGuid (&Vendor->Guid, &mEfiWinNtGopGuid)) {
- CatPrint (Str, L"%s", L"GOP");
- return ;
- } else if (CompareGuid (&Vendor->Guid, &mEfiWinNtSerialPortGuid)) {
- CatPrint (Str, L"%s", L"Serial");
- return ;
- }
-#endif
break;
case MESSAGING_DEVICE_PATH:
@@ -346,7 +322,7 @@ DevPathVendor (
} else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
CatPrint (Str, L"VenUft8()");
return ;
- } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) {
+ } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid )) {
FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);
switch (FlowControlMap & 0x00000003) {
case 0:
@@ -367,7 +343,7 @@ DevPathVendor (
return ;
- } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) {
+ } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {
CatPrint (
Str,
L"SAS(%lx,%lx,%x,",
@@ -424,7 +400,6 @@ DevPathVendor (
CatPrint (Str, L")");
}
-
/**
Convert Device Path to a Unicode string for printing.
@@ -468,6 +443,7 @@ DevPathExtendedAcpi (
)
{
ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
+
//
// Index for HID, UID and CID strings, 0 for non-exist
//
@@ -1550,7 +1526,7 @@ DevicePathToStr (
//
// Shrink pool used for string allocation
//
- gBS->FreePool (DevPath);
+ SafeFreePool (DevPath);
Done:
NewSize = (Str.len + 1) * sizeof (CHAR16);
@@ -1560,7 +1536,6 @@ Done:
return Str.str;
}
-
/**
Function creates a device path data structure that identically matches the
device path passed in.