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@6457 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2008-11-11 15:43:50 +00:00
parent 1232b21473
commit 2067710de0
8 changed files with 23 additions and 50 deletions

View File

@ -60,36 +60,6 @@ InternalReportStatusCode (
}
/**
Computes and returns the size, in bytes, of a device path.
@param DevicePath A pointer to a device path.
@return The size, in bytes, of DevicePath.
**/
UINTN
InternalReportStatusCodeDevicePathSize (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
CONST EFI_DEVICE_PATH_PROTOCOL *Start;
//
// Search for the end of the device path structure
//
Start = DevicePath;
while (!EfiIsDevicePathEnd (DevicePath)) {
DevicePath = EfiNextDevicePathNode (DevicePath);
}
//
// Subtract the start node from the end node and add in the size of the end node
//
return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);
}
/**
Converts a status code to an 8-bit POST code value.
@ -340,12 +310,12 @@ ReportStatusCodeWithDevicePath (
)
{
ASSERT (DevicePath != NULL);
return ReportStatusCodeWithExtendedData (
Type,
Value,
(VOID *)DevicePath,
InternalReportStatusCodeDevicePathSize (DevicePath)
);
//
// this function can *not* be implemented for BASE library.
//
ASSERT (FALSE);
return EFI_UNSUPPORTED;
}