Skip to content

Commit aee8045

Browse files
nicholasbishopphip1611
authored andcommitted
uefi-raw: Add MemoryAttributeProtocol
1 parent c7e8361 commit aee8045

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
use crate::table::boot::MemoryAttribute;
2+
use crate::{guid, Guid, PhysicalAddress, Status};
3+
4+
#[repr(C)]
5+
pub struct MemoryAttributeProtocol {
6+
pub get_memory_attributes: unsafe extern "efiapi" fn(
7+
this: *const Self,
8+
base_address: PhysicalAddress,
9+
length: u64,
10+
attributes: *mut MemoryAttribute,
11+
) -> Status,
12+
13+
pub set_memory_attributes: unsafe extern "efiapi" fn(
14+
this: *const Self,
15+
base_address: PhysicalAddress,
16+
length: u64,
17+
attributes: MemoryAttribute,
18+
) -> Status,
19+
20+
pub clear_memory_attributes: unsafe extern "efiapi" fn(
21+
this: *const Self,
22+
base_address: PhysicalAddress,
23+
length: u64,
24+
attributes: MemoryAttribute,
25+
) -> Status,
26+
}
27+
28+
impl MemoryAttributeProtocol {
29+
pub const GUID: Guid = guid!("f4560cf6-40ec-4b4a-a192-bf1d57d0b189");
30+
}

uefi-raw/src/protocol/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ pub mod console;
99
pub mod device_path;
1010
pub mod disk;
1111
pub mod loaded_image;
12+
pub mod memory_protection;
1213
pub mod rng;

0 commit comments

Comments
 (0)