El1Mpu

Struct El1Mpu 

Source
pub struct El1Mpu();
Expand description

Represents our PMSAv8-32 EL1 MPU

Implementations§

Source§

impl El1Mpu

Source

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.

Source

pub fn num_regions(&self) -> u8

How many MPU regions are there?

Source

pub fn get_region(&mut self, idx: u8) -> Option<El1Region>

Access the current state of a region

Source

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:

Source

pub fn set_regions( &mut self, regions_starting_idx: u8, regions: &[El1Region], ) -> Result<(), Error>

Writes a subset of EL1 MPU regions starting from a specified index.

§Arguments
  • regions_starting_idx: The starting index for the regions to be reconfigured.
  • regions: A slice of El1Region objects that will overwrite the previous regions starting from regions_starting_idx.
Source

pub fn set_attributes(&mut self, memattrs: &[MemAttr])

Set the memory attributes to MAIR0 and MAIR1

Source

pub fn background_region_enable(&mut self, enable: bool)

Enable or disable the background region

Source

pub fn configure(&mut self, config: &El1Config<'_>) -> Result<(), Error>

Configure the EL1 MPU

Write regions, attributes and enable/disable the background region with a single El1Config struct.

Source

pub fn enable(&mut self)

Enable the EL1 MPU

Source

pub fn disable(&mut self)

Disable the EL1 MPU

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.