From 204d39222a0ff9f91fdffc2809de0b7f5aaabbae Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 23 Jan 2023 19:07:35 +0000 Subject: [efi] Add efi_path_terminate() utility function Signed-off-by: Michael Brown --- src/include/ipxe/efi/efi_path.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/efi/efi_path.h b/src/include/ipxe/efi/efi_path.h index 9dea74b5a..98b922ac1 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 * -- cgit v1.2.3-55-g7522