diff options
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r-- | MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf | 3 | ||||
-rw-r--r-- | MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c | 10 | ||||
-rw-r--r-- | MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c | 1 | ||||
-rw-r--r-- | MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf | 3 | ||||
-rw-r--r-- | MdeModulePkg/Library/GenericBdsLib/BdsBoot.c | 18 | ||||
-rw-r--r-- | MdeModulePkg/Library/GenericBdsLib/DevicePath.c | 75 |
7 files changed, 19 insertions, 93 deletions
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index 7c7dd74694..4eeab90e05 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -38,7 +38,7 @@ Abstract: #include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/MemoryAllocationLib.h>
-
+#include <Library/DevicePathLib.h>
EFI_DPC_PROTOCOL *mDpc = NULL;
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf index db2c318afb..1f148b2539 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf @@ -51,7 +51,8 @@ UefiRuntimeServicesTableLib
UefiLib
MemoryAllocationLib
-
+ DevicePathLib
+
[Protocols]
gEfiSimpleNetworkProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiNicIp4ConfigProtocolGuid # PROTOCOL ALWAYS_CONSUMED
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c index 21bfb8a7c2..b746c68bf5 100644 --- a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c +++ b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c @@ -1590,9 +1590,9 @@ UpdateFvFileDevicePath ( //
TempDevicePath = *DevicePath;
LastDeviceNode = TempDevicePath;
- while (!EfiIsDevicePathEnd (TempDevicePath)) {
- LastDeviceNode = TempDevicePath;
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);
+ while (!IsDevicePathEnd (TempDevicePath)) {
+ LastDeviceNode = TempDevicePath;
+ TempDevicePath = NextDevicePathNode (TempDevicePath);
}
GuidPoint = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode);
if (GuidPoint == NULL) {
@@ -1618,7 +1618,7 @@ UpdateFvFileDevicePath ( //
TempDevicePath = *DevicePath;
HasFvNode = FALSE;
- while (!EfiIsDevicePathEnd (TempDevicePath)) {
+ while (!IsDevicePathEnd (TempDevicePath)) {
//
// Use old Device Path
//
@@ -1627,7 +1627,7 @@ UpdateFvFileDevicePath ( HasFvNode = TRUE;
break;
}
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);
+ TempDevicePath = NextDevicePathNode (TempDevicePath);
}
if (!HasFvNode) {
diff --git a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c index b29e13a375..a3970ecf74 100644 --- a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c +++ b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c @@ -21,6 +21,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DevicePathLib.h>
#include <MdeModuleHii.h>
diff --git a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf index 65c71baf34..f5a7fc2ca3 100644 --- a/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf +++ b/MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf @@ -42,7 +42,8 @@ DebugLib
PcdLib
UefiRuntimeServicesTableLib
-
+ DevicePathLib
+
[Protocols]
gEfiDevicePathProtocolGuid
diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c index c8b2c59f52..efaf82addc 100644 --- a/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/MdeModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -523,7 +523,6 @@ MatchPartitionDevicePathNode ( )
{
HARDDRIVE_DEVICE_PATH *TmpHdPath;
- HARDDRIVE_DEVICE_PATH *TempPath;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
BOOLEAN Match;
EFI_DEVICE_PATH_PROTOCOL *BlockIoHdDevicePathNode;
@@ -559,20 +558,19 @@ MatchPartitionDevicePathNode ( // See if the harddrive device path in blockio matches the orig Hard Drive Node
//
TmpHdPath = (HARDDRIVE_DEVICE_PATH *) BlockIoHdDevicePathNode;
- TempPath = (HARDDRIVE_DEVICE_PATH *) BdsLibUnpackDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) HardDriveDevicePath);
Match = FALSE;
//
// Check for the match
//
- if ((TmpHdPath->MBRType == TempPath->MBRType) &&
- (TmpHdPath->SignatureType == TempPath->SignatureType)) {
+ if ((TmpHdPath->MBRType == HardDriveDevicePath->MBRType) &&
+ (TmpHdPath->SignatureType == HardDriveDevicePath->SignatureType)) {
switch (TmpHdPath->SignatureType) {
case SIGNATURE_TYPE_GUID:
- Match = CompareGuid ((EFI_GUID *)TmpHdPath->Signature, (EFI_GUID *)TempPath->Signature);
+ Match = CompareGuid ((EFI_GUID *)TmpHdPath->Signature, (EFI_GUID *)HardDriveDevicePath->Signature);
break;
case SIGNATURE_TYPE_MBR:
- Match = (BOOLEAN)(*((UINT32 *)(&(TmpHdPath->Signature[0]))) == *(UINT32 *)(&(TempPath->Signature[0])));
+ Match = (BOOLEAN)(*((UINT32 *)(&(TmpHdPath->Signature[0]))) == ReadUnaligned32((UINT32 *)(&(HardDriveDevicePath->Signature[0]))));
break;
default:
Match = FALSE;
@@ -1624,9 +1622,9 @@ BdsLibIsValidEFIBootOptDevicePath ( // If the boot option point to a file, it is a valid EFI boot option,
// and assume it is ready to boot now
//
- while (!EfiIsDevicePathEnd (TempDevicePath)) {
+ while (!IsDevicePathEnd (TempDevicePath)) {
LastDeviceNode = TempDevicePath;
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);
+ TempDevicePath = NextDevicePathNode (TempDevicePath);
}
if ((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) &&
(DevicePathSubType (LastDeviceNode) == MEDIA_FILEPATH_DP)) {
@@ -1765,9 +1763,9 @@ BdsLibUpdateFvFileDevicePath ( //
TempDevicePath = *DevicePath;
LastDeviceNode = TempDevicePath;
- while (!EfiIsDevicePathEnd (TempDevicePath)) {
+ while (!IsDevicePathEnd (TempDevicePath)) {
LastDeviceNode = TempDevicePath;
- TempDevicePath = EfiNextDevicePathNode (TempDevicePath);
+ TempDevicePath = NextDevicePathNode (TempDevicePath);
}
GuidPoint = EfiGetNameGuidFromFwVolDevicePathNode (
(MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode
diff --git a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c index affb009d4b..f420625fc9 100644 --- a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c +++ b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c @@ -112,75 +112,6 @@ CatPrint ( return Str->str;
}
-
-/**
- Function unpacks a device path data structure so that all the nodes
- of a device path are naturally aligned.
-
- @param DevPath A pointer to a device path data structure
-
- @return A ponter to new device If the memory for the device path is successfully allocated, then a
- pointer to the new device path is returned. Otherwise, NULL is returned.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-BdsLibUnpackDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *Src;
- EFI_DEVICE_PATH_PROTOCOL *Dest;
- EFI_DEVICE_PATH_PROTOCOL *NewPath;
- UINTN Size;
-
- //
- // Walk device path and round sizes to valid boundries
- //
- Src = DevPath;
- Size = 0;
- for (;;) {
- Size += DevicePathNodeLength (Src);
- Size += ALIGN_SIZE (Size);
-
- if (IsDevicePathEnd (Src)) {
- break;
- }
-
- Src = NextDevicePathNode (Src);
- }
- //
- // Allocate space for the unpacked path
- //
- NewPath = AllocateZeroPool (Size);
- if (NewPath != NULL) {
-
- ASSERT (((UINTN) NewPath) % MIN_ALIGNMENT_SIZE == 0);
-
- //
- // Copy each node
- //
- Src = DevPath;
- Dest = NewPath;
- for (;;) {
- Size = DevicePathNodeLength (Src);
- CopyMem (Dest, Src, Size);
- Size += ALIGN_SIZE (Size);
- SetDevicePathNodeLength (Dest, Size);
- Dest->Type |= EFI_DP_TYPE_UNPACKED;
- Dest = (EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) Dest) + Size);
-
- if (IsDevicePathEnd (Src)) {
- break;
- }
-
- Src = NextDevicePathNode (Src);
- }
- }
-
- return NewPath;
-}
-
/**
Convert Device Path to a Unicode string for printing.
@@ -1546,12 +1477,6 @@ DevicePathToStr ( }
//
- // Unpacked the device path
- //
- DevPath = BdsLibUnpackDevicePath (DevPath);
- ASSERT (DevPath);
-
- //
// Process each device path node
//
DevPathNode = DevPath;
|