diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-11-11 15:42:40 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-11-11 15:42:40 +0000 |
commit | 1232b21473646661a4ac1ae4b7bf5113d4613e83 (patch) | |
tree | d941add025ac902858b1aa8cf38ffaa055baa41b /MdeModulePkg/Library/GenericBdsLib/DevicePath.c | |
parent | e5dab01618850f8c8be029336ad93dcd1680865f (diff) | |
download | edk2-1232b21473646661a4ac1ae4b7bf5113d4613e83.zip edk2-1232b21473646661a4ac1ae4b7bf5113d4613e83.tar.gz edk2-1232b21473646661a4ac1ae4b7bf5113d4613e83.tar.bz2 |
1, Add <Library/DevicePathLib.h> for all source that use device path utility macros
2, Add DevicePathLib library class to module's INF that use device path utility macros
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6456 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/GenericBdsLib/DevicePath.c')
-rw-r--r-- | MdeModulePkg/Library/GenericBdsLib/DevicePath.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/MdeModulePkg/Library/GenericBdsLib/DevicePath.c b/MdeModulePkg/Library/GenericBdsLib/DevicePath.c index affb009..f420625 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;
|