*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
This commit is contained in:
qhuang8
2006-05-11 07:19:55 +00:00
parent cfb190d9f4
commit 5f10fa0140
10 changed files with 1357 additions and 618 deletions

View File

@ -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);
NodeLength = DevicePathNodeLength (DevicePathNode);
//
// 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);
//
// 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;
}