diff options
author | Michael Brown | 2015-09-11 00:22:43 +0200 |
---|---|---|
committer | Michael Brown | 2015-09-13 13:54:31 +0200 |
commit | 7107334391d05bd60a44daaee732c19860ca87bc (patch) | |
tree | 143821c45a4d75e3ca6808321200704abbabbbc2 /src/interface/efi/efi_utils.c | |
parent | [xhci] Support arbitrarily large transfers (diff) | |
download | ipxe-7107334391d05bd60a44daaee732c19860ca87bc.tar.gz ipxe-7107334391d05bd60a44daaee732c19860ca87bc.tar.xz ipxe-7107334391d05bd60a44daaee732c19860ca87bc.zip |
[efi] Provide efi_devpath_len()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_utils.c')
-rw-r--r-- | src/interface/efi/efi_utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/interface/efi/efi_utils.c b/src/interface/efi/efi_utils.c index 1bebaa56..4dc75414 100644 --- a/src/interface/efi/efi_utils.c +++ b/src/interface/efi/efi_utils.c @@ -51,6 +51,18 @@ EFI_DEVICE_PATH_PROTOCOL * efi_devpath_end ( EFI_DEVICE_PATH_PROTOCOL *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 * * @v device EFI device handle |