Skip to content

Commit d2a4001

Browse files
uefi-raw: Add LoadedImageProtocol
1 parent 026d856 commit d2a4001

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

uefi-raw/src/protocol/loaded_image.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
use crate::protocol::device_path::DevicePathProtocol;
2+
use crate::table::boot::MemoryType;
3+
use crate::table::system::SystemTable;
4+
use crate::{guid, Guid, Handle, Status};
5+
use core::ffi::c_void;
6+
7+
#[derive(Clone, Copy)]
8+
#[repr(C)]
9+
pub struct LoadedImageProtocol {
10+
pub revision: u32,
11+
pub parent_handle: Handle,
12+
pub system_table: *const SystemTable,
13+
14+
// Source location of the image.
15+
pub device_handle: Handle,
16+
pub file_path: *const DevicePathProtocol,
17+
18+
pub reserved: *const c_void,
19+
20+
// Image load options.
21+
pub load_options_size: u32,
22+
pub load_options: *const c_void,
23+
24+
// Location where image was loaded.
25+
pub image_base: *const c_void,
26+
pub image_size: u64,
27+
pub image_code_type: MemoryType,
28+
pub image_data_type: MemoryType,
29+
pub unload: Option<unsafe extern "efiapi" fn(image_handle: Handle) -> Status>,
30+
}
31+
32+
impl LoadedImageProtocol {
33+
pub const GUID: Guid = guid!("5b1b31a1-9562-11d2-8e3f-00a0c969723b");
34+
}

uefi-raw/src/protocol/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
77
pub mod console;
88
pub mod device_path;
9+
pub mod loaded_image;
910
pub mod rng;

0 commit comments

Comments
 (0)