Trait kernel::platform::mpu::MPU
[−]
[src]
pub trait MPU { fn enable_mpu(&self); fn disable_mpu(&self); fn create_region(
region_num: usize,
start: usize,
len: usize,
execute: ExecutePermission,
access: AccessPermission
) -> Option<Region>; fn set_mpu(&self, region: Region); }
Required Methods
fn enable_mpu(&self)
Enable the MPU.
Both privileged and unprivileged code are subject to the constraints of the active MPU regions. However, while unprivileged code cannot access any memory space that is is not explicitly authorized to, privileged code can access all unprotected (background) memory.
fn disable_mpu(&self)
Completely disable the MPU.
fn create_region(
region_num: usize,
start: usize,
len: usize,
execute: ExecutePermission,
access: AccessPermission
) -> Option<Region>
region_num: usize,
start: usize,
len: usize,
execute: ExecutePermission,
access: AccessPermission
) -> Option<Region>
Creates a new MPU-specific memory protection region
region_num
: an MPU region number 0-7
start_addr
: the region base address. Lower bits will be masked
according to the region size.
len
: region size as a PowerOfTwo (e.g. 16
for 64KB)
execute
: whether to enable code execution from this region
ap
: access permissions as defined in Table 4.47 of the user
guide.
fn set_mpu(&self, region: Region)
Sets the base address, size and access attributes of the given MPU region number.
Implementors
impl MPU for ()