pub struct El1Mpu();Expand description
Represents our PMSAv8-32 EL1 MPU
Implementations§
Source§impl El1Mpu
impl El1Mpu
Sourcepub unsafe fn new() -> El1Mpu
pub unsafe fn new() -> El1Mpu
Create an 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 MPU regions are there?
Sourcepub fn get_region(&mut self, idx: u8) -> Option<El1Region>
pub fn get_region(&mut self, idx: u8) -> Option<El1Region>
Access the current state of a region
Sourcepub fn set_region(&mut self, idx: u8, region: &El1Region) -> Result<(), Error>
pub fn set_region(&mut self, idx: u8, region: &El1Region) -> Result<(), Error>
Write a single region to the EL1 MPU
§Arguments
region: The El1Region 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: &[El1Region],
) -> Result<(), Error>
pub fn set_regions( &mut self, regions_starting_idx: u8, regions: &[El1Region], ) -> Result<(), Error>
Sourcepub fn set_attributes(&mut self, memattrs: &[MemAttr])
pub fn set_attributes(&mut self, memattrs: &[MemAttr])
Set the memory attributes to MAIR0 and MAIR1
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 El1Mpu
impl RefUnwindSafe for El1Mpu
impl Send for El1Mpu
impl Sync for El1Mpu
impl Unpin for El1Mpu
impl UnwindSafe for El1Mpu
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