El2Mpu

Struct El2Mpu 

Source
pub struct El2Mpu();
Expand description

Represents our PMSAv8-32 EL2 MPU

Implementations§

Source§

impl El2Mpu

Source

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.

Source

pub fn num_regions(&self) -> u8

How many EL2 MPU regions are there?

Source

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

Access the current state of a region

Source

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:

Source

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

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

§Arguments
  • regions_starting_idx: The starting index for the regions to be reconfigured.
  • regions: A slice of El2Region 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 HMAIR0 and HMAIR1

Source

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

Enable or disable the background region

Source

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

Configure the EL2 MPU

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

Source

pub fn enable(&mut self)

Enable the EL2 MPU

Source

pub fn disable(&mut self)

Disable the EL2 MPU

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> 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.