Skip to content

Commit 92255cb

Browse files
nicholasbishopRaitoBezarius
authored andcommitted
uefi-raw: Add LoadFileProtocol and LoadFile2Protocol
Co-authored-by: Raito Bezarius <[email protected]>
1 parent 92b4c21 commit 92255cb

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

uefi-raw/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Added `IpAddress`, `Ipv4Address`, `Ipv6Address`, and `MacAddress` types.
55
- Added `ServiceBindingProtocol`, `Dhcp4Protocol`, `HttpProtocol`,
66
`Ip4Config2Protocol`, `TlsConfigurationProtocol`, and related types.
7+
- Added `LoadFileProtocol` and `LoadFile2Protocol`.
78

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

uefi-raw/src/protocol/media.rs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
use crate::protocol::device_path::DevicePathProtocol;
2+
use crate::{guid, Guid, Status};
3+
use core::ffi::c_void;
4+
5+
#[derive(Debug)]
6+
#[repr(C)]
7+
pub struct LoadFileProtocol {
8+
pub load_file: unsafe extern "efiapi" fn(
9+
this: *mut LoadFileProtocol,
10+
file_path: *const DevicePathProtocol,
11+
boot_policy: bool,
12+
buffer_size: *mut usize,
13+
buffer: *mut c_void,
14+
) -> Status,
15+
}
16+
17+
impl LoadFileProtocol {
18+
pub const GUID: Guid = guid!("56ec3091-954c-11d2-8e3f-00a0c969723b");
19+
}
20+
21+
#[derive(Debug)]
22+
#[repr(C)]
23+
pub struct LoadFile2Protocol {
24+
pub load_file: unsafe extern "efiapi" fn(
25+
this: *mut LoadFile2Protocol,
26+
file_path: *const DevicePathProtocol,
27+
boot_policy: bool,
28+
buffer_size: *mut usize,
29+
buffer: *mut c_void,
30+
) -> Status,
31+
}
32+
33+
impl LoadFile2Protocol {
34+
pub const GUID: Guid = guid!("4006c0c1-fcb3-403e-996d-4a6c8724e06d");
35+
}

uefi-raw/src/protocol/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub mod disk;
1111
pub mod driver;
1212
pub mod file_system;
1313
pub mod loaded_image;
14+
pub mod media;
1415
pub mod memory_protection;
1516
pub mod network;
1617
pub mod rng;

0 commit comments

Comments
 (0)