Struct cortexm::mpu::MPU

source ·
pub struct MPU<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> { /* private fields */ }
Expand description

State related to the real physical MPU.

There should only be one instantiation of this object as it represents real hardware.

Implementations§

source§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> MPU<NUM_REGIONS, MIN_REGION_SIZE>

source

pub const unsafe fn new() -> Self

source

pub unsafe fn clear_mpu(&self)

Trait Implementations§

source§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> MPU for MPU<NUM_REGIONS, MIN_REGION_SIZE>

§

type MpuConfig = CortexMConfig<NUM_REGIONS>

MPU-specific state that defines a particular configuration for the MPU. That is, this should contain all of the required state such that the implementation can be passed an object of this type and it should be able to correctly and entirely configure the MPU. Read more
source§

fn enable_app_mpu(&self)

Enables the MPU for userspace apps. Read more
source§

fn disable_app_mpu(&self)

Disables the MPU for userspace apps. Read more
source§

fn number_total_regions(&self) -> usize

Returns the maximum number of regions supported by the MPU.
source§

fn new_config(&self) -> Option<Self::MpuConfig>

Creates a new empty MPU configuration. Read more
source§

fn reset_config(&self, config: &mut Self::MpuConfig)

Resets an MPU configuration. Read more
source§

fn allocate_region( &self, unallocated_memory_start: *const u8, unallocated_memory_size: usize, min_region_size: usize, permissions: Permissions, config: &mut Self::MpuConfig ) -> Option<Region>

Allocates a new MPU region. Read more
source§

fn remove_memory_region( &self, region: Region, config: &mut Self::MpuConfig ) -> Result<(), ()>

Removes an MPU region within app-owned memory. Read more
source§

fn allocate_app_memory_region( &self, unallocated_memory_start: *const u8, unallocated_memory_size: usize, min_memory_size: usize, initial_app_memory_size: usize, initial_kernel_memory_size: usize, permissions: Permissions, config: &mut Self::MpuConfig ) -> Option<(*const u8, usize)>

Chooses the location for a process’s memory, and allocates an MPU region covering the app-owned part. Read more
source§

fn update_app_memory_region( &self, app_memory_break: *const u8, kernel_memory_break: *const u8, permissions: Permissions, config: &mut Self::MpuConfig ) -> Result<(), ()>

Updates the MPU region for app-owned memory. Read more
source§

fn configure_mpu(&self, config: &Self::MpuConfig)

Configures the MPU with the provided region configuration. Read more

Auto Trait Implementations§

§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> !Freeze for MPU<NUM_REGIONS, MIN_REGION_SIZE>

§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> !RefUnwindSafe for MPU<NUM_REGIONS, MIN_REGION_SIZE>

§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> !Send for MPU<NUM_REGIONS, MIN_REGION_SIZE>

§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> !Sync for MPU<NUM_REGIONS, MIN_REGION_SIZE>

§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> Unpin for MPU<NUM_REGIONS, MIN_REGION_SIZE>

§

impl<const NUM_REGIONS: usize, const MIN_REGION_SIZE: usize> !UnwindSafe for MPU<NUM_REGIONS, MIN_REGION_SIZE>

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> SizedTypeProperties for T

source§

#[doc(hidden)] const IS_ZST: bool = _

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
source§

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

§

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

§

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.