From 6c84a8982b094c7598efeab1802d6a4932b214b9 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Thu, 28 Nov 2024 16:51:33 -0700 Subject: [PATCH] uefi-raw: Add DriverBindingProtocol Add the interface for EFI_DRIVER_BINDING_PROTOCOL. Ref: UEFI 2.10: 11.1 EFI Driver Binding Protocol Signed-off-by: Tim Crawford --- uefi-raw/CHANGELOG.md | 1 + uefi-raw/src/protocol/driver.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 900ed58a1..540a302d9 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -4,6 +4,7 @@ - Added `protocol::string::UnicodeCollationProtocol`. - Added `protocol::tcg` module, containing the TCG v1 and v2 protocols. +- Added `DriverBindingProtocol`. # uefi-raw - 0.9.0 (2024-10-23) diff --git a/uefi-raw/src/protocol/driver.rs b/uefi-raw/src/protocol/driver.rs index 52584d101..f474c3299 100644 --- a/uefi-raw/src/protocol/driver.rs +++ b/uefi-raw/src/protocol/driver.rs @@ -1,5 +1,34 @@ +use crate::protocol::device_path::DevicePathProtocol; use crate::{guid, Guid, Handle, Status}; +#[derive(Debug)] +#[repr(C)] +pub struct DriverBindingProtocol { + pub supported: unsafe extern "efiapi" fn( + this: *const Self, + controller_handle: Handle, + remaining_device_path: *const DevicePathProtocol, + ) -> Status, + pub start: unsafe extern "efiapi" fn( + this: *const Self, + controller_handle: Handle, + remaining_device_path: *const DevicePathProtocol, + ) -> Status, + pub stop: unsafe extern "efiapi" fn( + this: *const Self, + controller_handle: Handle, + number_of_children: usize, + child_handle_buffer: *const Handle, + ) -> Status, + pub version: u32, + pub image_handle: Handle, + pub driver_binding_handle: Handle, +} + +impl DriverBindingProtocol { + pub const GUID: Guid = guid!("18a031ab-b443-4d1a-a5c0-0c09261e9f71"); +} + #[derive(Debug)] #[repr(C)] pub struct ComponentName2Protocol {