mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 01:22:37 +03:00
[efi] Provide efi_devpath_len()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -50,6 +50,18 @@ EFI_DEVICE_PATH_PROTOCOL * efi_devpath_end ( EFI_DEVICE_PATH_PROTOCOL *path ) {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find length of device path (excluding terminator)
|
||||
*
|
||||
* @v path Path to device
|
||||
* @ret path_len Length of device path
|
||||
*/
|
||||
size_t efi_devpath_len ( EFI_DEVICE_PATH_PROTOCOL *path ) {
|
||||
EFI_DEVICE_PATH_PROTOCOL *end = efi_devpath_end ( path );
|
||||
|
||||
return ( ( ( void * ) end ) - ( ( void * ) path ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Locate parent device supporting a given protocol
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user