diff options
author | Michael Brown | 2023-01-23 20:07:35 +0100 |
---|---|---|
committer | Michael Brown | 2023-01-23 20:27:11 +0100 |
commit | 204d39222a0ff9f91fdffc2809de0b7f5aaabbae (patch) | |
tree | 64e2faac8d8d6141a54c867482cd3b36755ea06d /src/include/ipxe/efi/efi_path.h | |
parent | [arm] Inhibit linker warnings about an implied executable stack (diff) | |
download | ipxe-204d39222a0ff9f91fdffc2809de0b7f5aaabbae.tar.gz ipxe-204d39222a0ff9f91fdffc2809de0b7f5aaabbae.tar.xz ipxe-204d39222a0ff9f91fdffc2809de0b7f5aaabbae.zip |
[efi] Add efi_path_terminate() utility function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/efi/efi_path.h')
-rw-r--r-- | src/include/ipxe/efi/efi_path.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_path.h b/src/include/ipxe/efi/efi_path.h index 9dea74b5..98b922ac 100644 --- a/src/include/ipxe/efi/efi_path.h +++ b/src/include/ipxe/efi/efi_path.h @@ -21,6 +21,19 @@ struct fcp_description; struct ib_srp_device; struct usb_function; +/** + * Terminate device path + * + * @v end End of device path to fill in + */ +static inline void efi_path_terminate ( EFI_DEVICE_PATH_PROTOCOL *end ) { + + end->Type = END_DEVICE_PATH_TYPE; + end->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; + end->Length[0] = sizeof ( *end ); + end->Length[1] = 0; +} + extern EFI_DEVICE_PATH_PROTOCOL * efi_path_next ( EFI_DEVICE_PATH_PROTOCOL *path ); extern EFI_DEVICE_PATH_PROTOCOL * |