From cf1fd265678b6c0b02ca098dde0120c4b2258839 Mon Sep 17 00:00:00 2001 From: Markus Ebner Date: Mon, 31 Mar 2025 16:38:39 +0200 Subject: [PATCH] uefi-raw: Add binding for EFI_DEVICE_PATH_UTILITIES_PROTOCOL --- uefi-raw/CHANGELOG.md | 1 + uefi-raw/src/protocol/device_path.rs | 37 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 4f5d3130b..a6946025b 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -11,6 +11,7 @@ - Added `ExtScsiPassThruProtocol`. - Added `NvmExpressPassThruProtocol`. - Added `AtaPassThruProtocol`. +- Added `DevicePathUtilitiesProtocol`. # uefi-raw - 0.10.0 (2025-02-07) diff --git a/uefi-raw/src/protocol/device_path.rs b/uefi-raw/src/protocol/device_path.rs index 0cf3eae81..ad0635d6f 100644 --- a/uefi-raw/src/protocol/device_path.rs +++ b/uefi-raw/src/protocol/device_path.rs @@ -215,3 +215,40 @@ pub struct DevicePathFromTextProtocol { impl DevicePathFromTextProtocol { pub const GUID: Guid = guid!("05c99a21-c70f-4ad2-8a5f-35df3343f51e"); } + +#[derive(Debug)] +#[repr(C)] +pub struct DevicePathUtilitiesProtocol { + pub get_device_path_size: + unsafe extern "efiapi" fn(device_path: *const DevicePathProtocol) -> usize, + pub duplicate_device_path: unsafe extern "efiapi" fn( + device_path: *const DevicePathProtocol, + ) -> *const DevicePathProtocol, + pub append_device_path: unsafe extern "efiapi" fn( + src1: *const DevicePathProtocol, + src2: *const DevicePathProtocol, + ) -> *const DevicePathProtocol, + pub append_device_node: unsafe extern "efiapi" fn( + device_path: *const DevicePathProtocol, + device_node: *const DevicePathProtocol, + ) -> *const DevicePathProtocol, + pub append_device_path_instance: unsafe extern "efiapi" fn( + device_path: *const DevicePathProtocol, + device_path_instance: *const DevicePathProtocol, + ) -> *const DevicePathProtocol, + pub get_next_device_path_instance: unsafe extern "efiapi" fn( + device_path_instance: *mut *const DevicePathProtocol, + device_path_instance_size: *mut usize, + ) -> *const DevicePathProtocol, + pub is_device_path_multi_instance: + unsafe extern "efiapi" fn(device_path: *const DevicePathProtocol) -> bool, + pub create_device_node: unsafe extern "efiapi" fn( + node_type: DeviceType, + node_sub_type: DeviceSubType, + node_length: u16, + ) -> *const DevicePathProtocol, +} + +impl DevicePathUtilitiesProtocol { + pub const GUID: Guid = guid!("0379be4e-d706-437d-b037-edb82fb772a4"); +}