#include <Library/BaseMemoryLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiLib.h>\r
+#include <Library/DevicePathLib.h>\r
\r
#include <IndustryStandard/Pci.h>\r
\r
// Get the Usb part first Begin node in full device path\r
//\r
UsbDevicePathBeginPtr = DevicePath;\r
- while ( (!EfiIsDevicePathEnd (UsbDevicePathBeginPtr))&&\r
+ while ( (!IsDevicePathEnd (UsbDevicePathBeginPtr))&&\r
((UsbDevicePathBeginPtr->Type != MESSAGING_DEVICE_PATH) ||\r
(UsbDevicePathBeginPtr->SubType != MSG_USB_DP &&\r
UsbDevicePathBeginPtr->SubType != MSG_USB_CLASS_DP\r
// Get the Usb part first End node in full device path\r
//\r
UsbDevicePathEndPtr = UsbDevicePathBeginPtr;\r
- while ((!EfiIsDevicePathEnd (UsbDevicePathEndPtr))&&\r
+ while ((!IsDevicePathEnd (UsbDevicePathEndPtr))&&\r
(UsbDevicePathEndPtr->Type == MESSAGING_DEVICE_PATH) &&\r
(UsbDevicePathEndPtr->SubType == MSG_USB_DP ||\r
UsbDevicePathEndPtr->SubType == MSG_USB_CLASS_DP\r
// Build a device path to the file in the FV to pass into gBS->LoadImage\r
//\r
EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, DriverName);\r
- mFvDevicePath.End.Type = EFI_END_ENTIRE_DEVICE_PATH;\r
- mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;\r
- SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL));\r
+ SetDevicePathEndNode (&mFvDevicePath.End);\r
\r
FileNameDevicePath = AppendDevicePath (\r
FvDevicePath,\r
// be initialized completely.\r
//\r
EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, &NameGuid);\r
- mFvDevicePath.End.Type = EFI_END_ENTIRE_DEVICE_PATH;\r
- mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;\r
- SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL));\r
+ SetDevicePathEndNode (&mFvDevicePath.End);\r
\r
gDxeCoreLoadedImage->FilePath = DuplicateDevicePath (\r
(EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath\r
//\r
// Bds device path related lib functions\r
//\r
-/**\r
- Function unpacks a device path data structure so that all the nodes\r
- of a device path are naturally aligned.\r
-\r
- @param DevPath A pointer to a device path data structure\r
-\r
- @return If the memory for the device path is successfully allocated, then a\r
- pointer to the new device path is returned. Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-BdsLibUnpackDevicePath (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- );\r
-\r
/**\r
Delete the instance in Multi which matches partly with Single instance\r
\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
#include <Library/UefiLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
-\r
+#include <Library/DevicePathLib.h>\r
\r
EFI_DPC_PROTOCOL *mDpc = NULL;\r
\r
UefiRuntimeServicesTableLib\r
UefiLib\r
MemoryAllocationLib\r
-\r
+ DevicePathLib\r
+ \r
[Protocols]\r
gEfiSimpleNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiNicIp4ConfigProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
//\r
TempDevicePath = *DevicePath;\r
LastDeviceNode = TempDevicePath;\r
- while (!EfiIsDevicePathEnd (TempDevicePath)) {\r
- LastDeviceNode = TempDevicePath;\r
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);\r
+ while (!IsDevicePathEnd (TempDevicePath)) {\r
+ LastDeviceNode = TempDevicePath;\r
+ TempDevicePath = NextDevicePathNode (TempDevicePath);\r
}\r
GuidPoint = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode);\r
if (GuidPoint == NULL) {\r
//\r
TempDevicePath = *DevicePath;\r
HasFvNode = FALSE;\r
- while (!EfiIsDevicePathEnd (TempDevicePath)) {\r
+ while (!IsDevicePathEnd (TempDevicePath)) {\r
//\r
// Use old Device Path\r
//\r
HasFvNode = TRUE;\r
break;\r
}\r
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);\r
+ TempDevicePath = NextDevicePathNode (TempDevicePath);\r
}\r
\r
if (!HasFvNode) {\r
#include <Library/DebugLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
#include <MdeModuleHii.h>\r
\r
\r
DebugLib\r
PcdLib\r
UefiRuntimeServicesTableLib\r
-\r
+ DevicePathLib\r
+ \r
[Protocols]\r
gEfiDevicePathProtocolGuid \r
\r
)\r
{\r
HARDDRIVE_DEVICE_PATH *TmpHdPath;\r
- HARDDRIVE_DEVICE_PATH *TempPath;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
BOOLEAN Match;\r
EFI_DEVICE_PATH_PROTOCOL *BlockIoHdDevicePathNode;\r
// See if the harddrive device path in blockio matches the orig Hard Drive Node\r
//\r
TmpHdPath = (HARDDRIVE_DEVICE_PATH *) BlockIoHdDevicePathNode;\r
- TempPath = (HARDDRIVE_DEVICE_PATH *) BdsLibUnpackDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) HardDriveDevicePath);\r
Match = FALSE;\r
\r
//\r
// Check for the match\r
//\r
- if ((TmpHdPath->MBRType == TempPath->MBRType) &&\r
- (TmpHdPath->SignatureType == TempPath->SignatureType)) {\r
+ if ((TmpHdPath->MBRType == HardDriveDevicePath->MBRType) &&\r
+ (TmpHdPath->SignatureType == HardDriveDevicePath->SignatureType)) {\r
switch (TmpHdPath->SignatureType) {\r
case SIGNATURE_TYPE_GUID:\r
- Match = CompareGuid ((EFI_GUID *)TmpHdPath->Signature, (EFI_GUID *)TempPath->Signature);\r
+ Match = CompareGuid ((EFI_GUID *)TmpHdPath->Signature, (EFI_GUID *)HardDriveDevicePath->Signature);\r
break;\r
case SIGNATURE_TYPE_MBR:\r
- Match = (BOOLEAN)(*((UINT32 *)(&(TmpHdPath->Signature[0]))) == *(UINT32 *)(&(TempPath->Signature[0])));\r
+ Match = (BOOLEAN)(*((UINT32 *)(&(TmpHdPath->Signature[0]))) == ReadUnaligned32((UINT32 *)(&(HardDriveDevicePath->Signature[0]))));\r
break;\r
default:\r
Match = FALSE;\r
// If the boot option point to a file, it is a valid EFI boot option,\r
// and assume it is ready to boot now\r
//\r
- while (!EfiIsDevicePathEnd (TempDevicePath)) {\r
+ while (!IsDevicePathEnd (TempDevicePath)) {\r
LastDeviceNode = TempDevicePath;\r
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);\r
+ TempDevicePath = NextDevicePathNode (TempDevicePath);\r
}\r
if ((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) &&\r
(DevicePathSubType (LastDeviceNode) == MEDIA_FILEPATH_DP)) {\r
//\r
TempDevicePath = *DevicePath;\r
LastDeviceNode = TempDevicePath;\r
- while (!EfiIsDevicePathEnd (TempDevicePath)) {\r
+ while (!IsDevicePathEnd (TempDevicePath)) {\r
LastDeviceNode = TempDevicePath;\r
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);\r
+ TempDevicePath = NextDevicePathNode (TempDevicePath);\r
}\r
GuidPoint = EfiGetNameGuidFromFwVolDevicePathNode (\r
(MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode\r
return Str->str;\r
}\r
\r
-\r
-/**\r
- Function unpacks a device path data structure so that all the nodes\r
- of a device path are naturally aligned.\r
-\r
- @param DevPath A pointer to a device path data structure\r
-\r
- @return A ponter to new device If the memory for the device path is successfully allocated, then a\r
- pointer to the new device path is returned. Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-EFIAPI\r
-BdsLibUnpackDevicePath (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- )\r
-{\r
- EFI_DEVICE_PATH_PROTOCOL *Src;\r
- EFI_DEVICE_PATH_PROTOCOL *Dest;\r
- EFI_DEVICE_PATH_PROTOCOL *NewPath;\r
- UINTN Size;\r
-\r
- //\r
- // Walk device path and round sizes to valid boundries\r
- //\r
- Src = DevPath;\r
- Size = 0;\r
- for (;;) {\r
- Size += DevicePathNodeLength (Src);\r
- Size += ALIGN_SIZE (Size);\r
-\r
- if (IsDevicePathEnd (Src)) {\r
- break;\r
- }\r
-\r
- Src = NextDevicePathNode (Src);\r
- }\r
- //\r
- // Allocate space for the unpacked path\r
- //\r
- NewPath = AllocateZeroPool (Size);\r
- if (NewPath != NULL) {\r
-\r
- ASSERT (((UINTN) NewPath) % MIN_ALIGNMENT_SIZE == 0);\r
-\r
- //\r
- // Copy each node\r
- //\r
- Src = DevPath;\r
- Dest = NewPath;\r
- for (;;) {\r
- Size = DevicePathNodeLength (Src);\r
- CopyMem (Dest, Src, Size);\r
- Size += ALIGN_SIZE (Size);\r
- SetDevicePathNodeLength (Dest, Size);\r
- Dest->Type |= EFI_DP_TYPE_UNPACKED;\r
- Dest = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) Dest) + Size);\r
-\r
- if (IsDevicePathEnd (Src)) {\r
- break;\r
- }\r
-\r
- Src = NextDevicePathNode (Src);\r
- }\r
- }\r
-\r
- return NewPath;\r
-}\r
-\r
/**\r
Convert Device Path to a Unicode string for printing.\r
\r
return ToText;\r
}\r
\r
- //\r
- // Unpacked the device path\r
- //\r
- DevPath = BdsLibUnpackDevicePath (DevPath);\r
- ASSERT (DevPath);\r
-\r
//\r
// Process each device path node\r
//\r
NewOptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (DescString) +\r
sizeof (BBS_BBS_DEVICE_PATH);\r
NewOptionSize += AsciiStrLen (DescAsciiString) +\r
- EFI_END_DEVICE_PATH_LENGTH + sizeof (BBS_TABLE) + sizeof (UINT16);\r
+ END_DEVICE_PATH_LENGTH + sizeof (BBS_TABLE) + sizeof (UINT16);\r
\r
UnicodeSPrint (VarName, 100, L"Boot%04x", Index);\r
\r
//\r
*((UINT16 *) TempPtr) = (UINT16) (sizeof (BBS_BBS_DEVICE_PATH) +\r
AsciiStrLen (DescAsciiString) +\r
- EFI_END_DEVICE_PATH_LENGTH);\r
+ END_DEVICE_PATH_LENGTH);\r
\r
TempPtr += sizeof (UINT16);\r
\r
CopyMem (\r
TempPtr,\r
EndDevicePath,\r
- EFI_END_DEVICE_PATH_LENGTH\r
+ END_DEVICE_PATH_LENGTH\r
);\r
- TempPtr += EFI_END_DEVICE_PATH_LENGTH;\r
+ TempPtr += END_DEVICE_PATH_LENGTH;\r
\r
//\r
// Now TempPtr point to optional data, i.e. Bbs Table\r
DebugPortDevice->DebugPortVariable\r
);\r
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DebugPortDevice->DebugPortVariable;\r
- while (!EfiIsDevicePathEnd (DevicePath) && !IS_UART_DEVICEPATH (DevicePath)) {\r
- DevicePath = EfiNextDevicePathNode (DevicePath);\r
+ while (!IsDevicePathEnd (DevicePath) && !IS_UART_DEVICEPATH (DevicePath)) {\r
+ DevicePath = NextDevicePathNode (DevicePath);\r
}\r
\r
- if (EfiIsDevicePathEnd (DevicePath)) {\r
+ if (IsDevicePathEnd (DevicePath)) {\r
FreePool (gDebugPortDevice->DebugPortVariable);\r
DebugPortDevice->DebugPortVariable = NULL;\r
} else {\r
\r
#include "DevicePath.h"\r
\r
-/**\r
- Function unpacks a device path data structure so that all the nodes of a device path\r
- are naturally aligned.\r
-\r
- @param DevPath A pointer to a device path data structure\r
-\r
- @return If the memory for the device path is successfully allocated, then a pointer to the\r
- new device path is returned. Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-UnpackDevicePath (\r
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- )\r
-{\r
- CONST EFI_DEVICE_PATH_PROTOCOL *Src;\r
- EFI_DEVICE_PATH_PROTOCOL *Dest;\r
- EFI_DEVICE_PATH_PROTOCOL *NewPath;\r
- UINTN Size;\r
-\r
- if (DevPath == NULL) {\r
- return NULL;\r
- }\r
- //\r
- // Walk device path and round sizes to valid boundries\r
- //\r
- Src = DevPath;\r
- Size = 0;\r
- for (;;) {\r
- Size += DevicePathNodeLength (Src);\r
- Size += ALIGN_SIZE (Size);\r
-\r
- if (IsDevicePathEnd (Src)) {\r
- break;\r
- }\r
-\r
- Src = (EFI_DEVICE_PATH_PROTOCOL *) NextDevicePathNode (Src);\r
- }\r
- //\r
- // Allocate space for the unpacked path\r
- //\r
- NewPath = AllocateZeroPool (Size);\r
- if (NewPath != NULL) {\r
-\r
- ASSERT (((UINTN) NewPath) % MIN_ALIGNMENT_SIZE == 0);\r
-\r
- //\r
- // Copy each node\r
- //\r
- Src = DevPath;\r
- Dest = NewPath;\r
- for (;;) {\r
- Size = DevicePathNodeLength (Src);\r
- CopyMem (Dest, Src, Size);\r
- Size += ALIGN_SIZE (Size);\r
- SetDevicePathNodeLength (Dest, Size);\r
- Dest->Type |= EFI_DP_TYPE_UNPACKED;\r
- Dest = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) Dest) + Size);\r
-\r
- if (IsDevicePathEnd (Src)) {\r
- break;\r
- }\r
-\r
- Src = (EFI_DEVICE_PATH_PROTOCOL *) NextDevicePathNode (Src);\r
- }\r
- }\r
-\r
- return NewPath;\r
-}\r
-\r
/**\r
Adjusts the size of a previously allocated buffer.\r
\r
{\r
POOL_PRINT Str;\r
EFI_DEVICE_PATH_PROTOCOL *DevPathNode;\r
- EFI_DEVICE_PATH_PROTOCOL *UnpackDevPath;\r
+ EFI_DEVICE_PATH_PROTOCOL *AlignedDevPathNode;\r
UINTN Index;\r
UINTN NewSize;\r
VOID (*DumpNode) (POOL_PRINT *, VOID *, BOOLEAN, BOOLEAN);\r
\r
ZeroMem (&Str, sizeof (Str));\r
\r
- //\r
- // Unpacked the device path\r
- //\r
- UnpackDevPath = UnpackDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) DevicePath);\r
- ASSERT (UnpackDevPath != NULL);\r
-\r
//\r
// Process each device path node\r
//\r
- DevPathNode = UnpackDevPath;\r
+ DevPathNode = (EFI_DEVICE_PATH_PROTOCOL *) DevicePath;\r
while (!IsDevicePathEnd (DevPathNode)) {\r
//\r
// Find the handler to dump this device path node\r
CatPrint (&Str, L"/");\r
}\r
}\r
+ \r
+ AlignedDevPathNode = AllocateCopyPool (DevicePathNodeLength (DevPathNode), DevPathNode);\r
//\r
// Print this node of the device path\r
//\r
- DumpNode (&Str, DevPathNode, DisplayOnly, AllowShortcuts);\r
-\r
+ DumpNode (&Str, AlignedDevPathNode, DisplayOnly, AllowShortcuts);\r
+ FreePool (AlignedDevPathNode);\r
+ \r
//\r
// Next device path node\r
//\r
DevPathNode = NextDevicePathNode (DevPathNode);\r
}\r
- //\r
- // Shrink pool used for string allocation\r
- //\r
- FreePool (UnpackDevPath);\r
\r
NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
Str.Str = ReallocatePool (Str.Str, NewSize, NewSize);\r
LastDevicePathNode = NULL;\r
ZeroMem (&ParentHdDev, sizeof (ParentHdDev));\r
DevicePathNode = DevicePath;\r
- while (!EfiIsDevicePathEnd (DevicePathNode)) {\r
+ while (!IsDevicePathEnd (DevicePathNode)) {\r
LastDevicePathNode = DevicePathNode;\r
- DevicePathNode = EfiNextDevicePathNode (DevicePathNode);\r
+ DevicePathNode = NextDevicePathNode (DevicePathNode);\r
}\r
\r
if (LastDevicePathNode != NULL) {\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
\r
#include <WorkingBlockHeader.h>\r
\r
UefiDriverEntryPoint\r
DebugLib\r
PcdLib\r
-\r
+ DevicePathLib\r
+ \r
[Guids]\r
gEfiSystemNvDataFvGuid # ALWAYS_CONSUMED\r
\r
\r
Node->DevPath.Type = MESSAGING_DEVICE_PATH;\r
Node->DevPath.SubType = MSG_ISCSI_DP;\r
- SetDevicePathNodeLength (&Node->DevPath, DevPathNodeLen);\r
+ SetDevicePathNodeLength (&Node->DevPath, (UINT16)DevPathNodeLen);\r
\r
//\r
// 0 for TCP, others are reserved.\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_DEVICE_PATH_PROTOCOL *DevPath;\r
EFI_DEVICE_PATH_PROTOCOL *DevPathNode;\r
+ EFI_DEVICE_PATH_PROTOCOL *AlignedDevPathNode;\r
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath;\r
VOID *Buffer;\r
UINTN BufferSize;\r
return NULL;\r
}\r
\r
- DevPath = UnpackDevicePath (Image->FilePath);\r
+ DevPathNode = Image->FilePath;\r
\r
- if (DevPath == NULL) {\r
+ if (DevPathNode == NULL) {\r
return NULL;\r
}\r
\r
- DevPathNode = DevPath;\r
-\r
while (!IsDevicePathEnd (DevPathNode)) {\r
+ //\r
+ // Make sure device path node is aligned when accessing it's FV Name Guid field.\r
+ //\r
+ AlignedDevPathNode = AllocateCopyPool (DevicePathNodeLength(DevPathNode), DevPathNode);\r
+ \r
//\r
// Find the Fv File path\r
//\r
- NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)DevPathNode);\r
+ NameGuid = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *)AlignedDevPathNode);\r
if (NameGuid != NULL) {\r
- FvFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) DevPathNode;\r
+ FvFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) AlignedDevPathNode;\r
Status = gBS->HandleProtocol (\r
Image->DeviceHandle,\r
&gEfiFirmwareVolume2ProtocolGuid,\r
&AuthenticationStatus\r
);\r
if (!EFI_ERROR (Status)) {\r
+ FreePool (AlignedDevPathNode);\r
break;\r
}\r
Buffer = NULL;\r
}\r
}\r
+ \r
+ FreePool (AlignedDevPathNode);\r
+ \r
//\r
// Next device path node\r
//\r
DevPathNode = NextDevicePathNode (DevPathNode);\r
}\r
\r
- gBS->FreePool (DevPath);\r
return Buffer;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
-/**\r
- Function unpacks a device path data structure so that all the nodes\r
- of a device path are naturally aligned.\r
-\r
- @param DevPath A pointer to a device path data structure\r
-\r
- @return If the memory for the device path is successfully allocated, then a\r
- @return pointer to the new device path is returned. Otherwise, NULL is returned.\r
-\r
-**/\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-UnpackDevicePath (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- )\r
-{\r
- EFI_DEVICE_PATH_PROTOCOL *Src;\r
- EFI_DEVICE_PATH_PROTOCOL *Dest;\r
- EFI_DEVICE_PATH_PROTOCOL *NewPath;\r
- UINTN Size;\r
-\r
- //\r
- // Walk device path and round sizes to valid boundries\r
- //\r
- Src = DevPath;\r
- Size = 0;\r
- for (;;) {\r
- Size += DevicePathNodeLength (Src);\r
- Size += ALIGN_SIZE (Size);\r
-\r
- if (IsDevicePathEnd (Src)) {\r
- break;\r
- }\r
-\r
- Src = NextDevicePathNode (Src);\r
- }\r
- //\r
- // Allocate space for the unpacked path\r
- //\r
- NewPath = AllocateZeroPool (Size);\r
- if (NewPath) {\r
-\r
- ASSERT (((UINTN) NewPath) % MIN_ALIGNMENT_SIZE == 0);\r
-\r
- //\r
- // Copy each node\r
- //\r
- Src = DevPath;\r
- Dest = NewPath;\r
- for (;;) {\r
- Size = DevicePathNodeLength (Src);\r
- CopyMem (Dest, Src, Size);\r
- Size += ALIGN_SIZE (Size);\r
- SetDevicePathNodeLength (Dest, Size);\r
- Dest->Type |= EFI_DP_TYPE_UNPACKED;\r
- Dest = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) Dest) + Size);\r
-\r
- if (IsDevicePathEnd (Src)) {\r
- break;\r
- }\r
-\r
- Src = NextDevicePathNode (Src);\r
- }\r
- }\r
-\r
- return NewPath;\r
-}\r
-\r
-\r
/**\r
Get the description string by device path.\r
\r
#include <Library/HiiLib.h>\r
#include <Library/ExtendedHiiLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
\r
#define MIN_ALIGNMENT_SIZE 4\r
#define ALIGN_SIZE(a) ((a % MIN_ALIGNMENT_SIZE) ? MIN_ALIGNMENT_SIZE - (a % MIN_ALIGNMENT_SIZE) : 0)\r
EFI_DEVICE_PATH_PROTOCOL *DevPath\r
);\r
\r
-\r
-EFI_DEVICE_PATH_PROTOCOL *\r
-UnpackDevicePath (\r
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r
- );\r
-\r
#endif\r
HiiLib\r
ExtendedHiiLib\r
UefiRuntimeServicesTableLib\r
-\r
+ DevicePathLib\r
+ \r
[Protocols]\r
gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r