Skip to content

uefi-raw: Add LoadFileProtocol and LoadFile2Protocol #1022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions uefi-raw/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Added `IpAddress`, `Ipv4Address`, `Ipv6Address`, and `MacAddress` types.
- Added `ServiceBindingProtocol`, `Dhcp4Protocol`, `HttpProtocol`,
`Ip4Config2Protocol`, `TlsConfigurationProtocol`, and related types.
- Added `LoadFileProtocol` and `LoadFile2Protocol`.

# uefi-raw - 0.5.0 (2023-11-12)

Expand Down
35 changes: 35 additions & 0 deletions uefi-raw/src/protocol/media.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use crate::protocol::device_path::DevicePathProtocol;
use crate::{guid, Guid, Status};
use core::ffi::c_void;

#[derive(Debug)]
#[repr(C)]
pub struct LoadFileProtocol {
pub load_file: unsafe extern "efiapi" fn(
this: *mut LoadFileProtocol,
file_path: *const DevicePathProtocol,
boot_policy: bool,
buffer_size: *mut usize,
buffer: *mut c_void,
) -> Status,
}

impl LoadFileProtocol {
pub const GUID: Guid = guid!("56ec3091-954c-11d2-8e3f-00a0c969723b");
}

#[derive(Debug)]
#[repr(C)]
pub struct LoadFile2Protocol {
pub load_file: unsafe extern "efiapi" fn(
this: *mut LoadFile2Protocol,
file_path: *const DevicePathProtocol,
boot_policy: bool,
buffer_size: *mut usize,
buffer: *mut c_void,
) -> Status,
}

impl LoadFile2Protocol {
pub const GUID: Guid = guid!("4006c0c1-fcb3-403e-996d-4a6c8724e06d");
}
1 change: 1 addition & 0 deletions uefi-raw/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub mod disk;
pub mod driver;
pub mod file_system;
pub mod loaded_image;
pub mod media;
pub mod memory_protection;
pub mod network;
pub mod rng;
Expand Down