diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-05-11 07:19:55 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-05-11 07:19:55 +0000 |
commit | 5f10fa0140f7100aa04c12f87d63a66755d20d58 (patch) | |
tree | 2339541698bfe4926b4d0fa976d9054f011ee9f8 /MdePkg/Library/UefiDevicePathLib | |
parent | cfb190d9f49ebb67b0c2a8fd6585713151bcd728 (diff) | |
download | edk2-5f10fa0140f7100aa04c12f87d63a66755d20d58.tar.gz edk2-5f10fa0140f7100aa04c12f87d63a66755d20d58.tar.bz2 edk2-5f10fa0140f7100aa04c12f87d63a66755d20d58.zip |
*BaseSmbusLib: (new version)
Complete function header, detailed description, ASSERT()s & pass smoke test in MRC of Lakeport package by replacing Smbus PPI.
*Device Patch Lib
Fix a bug in AppendDevicePathNode() (Solve Track #44 in Remodel PVCS). The original logic failed if the first device path was NULL.
*Performance Lib
Add PeiPerformanceHob & Performance protocol in spd file in EdkModule Package (Solve Tracker #41, #42 in Remodel PVCS).
*Hob Lib
Add detailed description for each Hob function.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@126 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/UefiDevicePathLib')
-rw-r--r-- | MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c index 8dc84f48b7..1b1376e2cf 100644 --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c @@ -155,9 +155,9 @@ AppendDevicePath ( This function appends the device path node SecondDevicePath
to every device path instance in FirstDevicePath.
- @param FirstDevicePath A pointer to a device path data structure.
+ @param DevicePath A pointer to a device path data structure.
- @param SecondDevicePath A pointer to a single device path node.
+ @param DevicePathNode A pointer to a single device path node.
@return A pointer to the new device path.
If there is not enough temporary pool memory available to complete this function,
@@ -167,40 +167,37 @@ AppendDevicePath ( EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePathNode (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode
)
{
+ EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
EFI_DEVICE_PATH_PROTOCOL *NextNode;
EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
UINTN NodeLength;
- UINTN Size1;
//
// Build a Node that has a terminator on it
//
- NodeLength = DevicePathNodeLength (SecondDevicePath);
- Size1 = GetDevicePathSize (FirstDevicePath);
-
- NewDevicePath = AllocatePool (NodeLength + Size1);
- if (NewDevicePath != NULL) {
- //
- // Copy the first device path to the new device path
- //
- NewDevicePath = CopyMem (NewDevicePath, FirstDevicePath, Size1);
-
- //
- // Copy the device path node to the new device path
- //
- NextNode = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));
- NextNode = CopyMem (NextNode, SecondDevicePath, NodeLength);
+ NodeLength = DevicePathNodeLength (DevicePathNode);
- //
- // Terminate the whole device path
- //
- NextNode = NextDevicePathNode (NextNode);
- SetDevicePathEndNode (NextNode);
+ TempDevicePath = AllocatePool (NodeLength + sizeof (EFI_DEVICE_PATH_PROTOCOL));
+ if (TempDevicePath == NULL) {
+ return NULL;
}
+ TempDevicePath = CopyMem (TempDevicePath, DevicePathNode, NodeLength);
+ //
+ // Add and end device path node to convert Node to device path
+ //
+ NextNode = NextDevicePathNode (TempDevicePath);
+ SetDevicePathEndNode (NextNode);
+ //
+ // Append device paths
+ //
+ NewDevicePath = AppendDevicePath (DevicePath, TempDevicePath);
+
+ FreePool (TempDevicePath);
+
return NewDevicePath;
}
|