Skip to content

Commit

Permalink
uefi-raw: Add MemoryAttributeProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasbishop committed Jul 15, 2023
1 parent ccddbcc commit 87804d3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions uefi-raw/src/protocol/memory_protection.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use crate::table::boot::MemoryAttribute;
use crate::{guid, Guid, PhysicalAddress, Status};

#[repr(C)]
pub struct MemoryAttributeProtocol {
pub get_memory_attributes: unsafe extern "efiapi" fn(
this: *const Self,
base_address: PhysicalAddress,
length: u64,
attributes: *mut MemoryAttribute,
) -> Status,

pub set_memory_attributes: unsafe extern "efiapi" fn(
this: *const Self,
base_address: PhysicalAddress,
length: u64,
attributes: MemoryAttribute,
) -> Status,

pub clear_memory_attributes: unsafe extern "efiapi" fn(
this: *const Self,
base_address: PhysicalAddress,
length: u64,
attributes: MemoryAttribute,
) -> Status,
}

impl MemoryAttributeProtocol {
pub const GUID: Guid = guid!("f4560cf6-40ec-4b4a-a192-bf1d57d0b189");
}
1 change: 1 addition & 0 deletions uefi-raw/src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
pub mod console;
pub mod device_path;
pub mod loaded_image;
pub mod memory_protection;
pub mod rng;

0 comments on commit 87804d3

Please sign in to comment.