pub struct El2Mpu();Expand description
Represents our PMSAv8-32 EL2 MPU
Implementations§
Source§impl El2Mpu
impl El2Mpu
Sourcepub unsafe fn new() -> El2Mpu
pub unsafe fn new() -> El2Mpu
Create an EL2 MPU handle
§Safety
Only create one of these at any given time, as they access shared mutable state within the processor and do read-modify-writes on that state.
Sourcepub fn num_regions(&self) -> u8
pub fn num_regions(&self) -> u8
How many EL2 MPU regions are there?
Sourcepub fn get_region(&mut self, idx: u8) -> Option<El2Region>
pub fn get_region(&mut self, idx: u8) -> Option<El2Region>
Access the current state of a region
Sourcepub fn set_region(&mut self, idx: u8, region: &El2Region) -> Result<(), Error>
pub fn set_region(&mut self, idx: u8, region: &El2Region) -> Result<(), Error>
Write a single region to the EL2 MPU
§Arguments
region: The El2Region object containing the configuration for the MPU region.idx: The index of the region to be configured.
§Errors
Returns:
- Error::UnalignedRegion if the region’s start address is not 64-byte aligned.
- Error::UnalignedRegion if the region’s end address is not 63-byte aligned.
- Error::InvalidMair if the region’s MAIR index is invalid (greater than 7).
Sourcepub fn set_regions(
&mut self,
regions_starting_idx: u8,
regions: &[El2Region],
) -> Result<(), Error>
pub fn set_regions( &mut self, regions_starting_idx: u8, regions: &[El2Region], ) -> Result<(), Error>
Sourcepub fn set_attributes(&mut self, memattrs: &[MemAttr])
pub fn set_attributes(&mut self, memattrs: &[MemAttr])
Set the memory attributes to HMAIR0 and HMAIR1
Sourcepub fn background_region_enable(&mut self, enable: bool)
pub fn background_region_enable(&mut self, enable: bool)
Enable or disable the background region
Auto Trait Implementations§
impl Freeze for El2Mpu
impl RefUnwindSafe for El2Mpu
impl Send for El2Mpu
impl Sync for El2Mpu
impl Unpin for El2Mpu
impl UnwindSafe for El2Mpu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more