Memory protection support internals for ARM architecture. More...
Modules | |
| MPU region names | |
| Names of ARM MPU regions as being used by CMRX. | |
Data Structures | |
| struct | MPU_Registers |
| ARMv6M/ARMv7M MPU registers for one region (base + size model) More... | |
Typedefs | |
| typedef struct MPU_Registers | MPU_State[MPU_STATE_SIZE] |
| Type handling MPU state as remembered by CMRX thread switcher. | |
Memory protection support internals for ARM architecture.
| typedef struct MPU_Registers MPU_State[MPU_STATE_SIZE] |
Type handling MPU state as remembered by CMRX thread switcher.
| uint32_t __mpu_expand_class | ( | uint8_t | class | ) |
| void hard_fault_handler | ( | void | ) |
Handler for hard fault.
| int mpu_clear_region | ( | uint8_t | region | ) |
Disable MPU region.
This function will disable use of MPU region. Address and size will remain configured, but region is not marked as enabled anymore.
| region | ID of region being deactivated (0 - 7) |
| int mpu_configure_region | ( | uint8_t | region, |
| const void * | base, | ||
| uint32_t | size, | ||
| uint8_t | cls, | ||
| struct MPU_Registers * | region_def | ||
| ) |
Create configuration for MPU region.
@TODO
|
inlinestatic |
Disable memory protection.
This routine will disable memory protection even for unprivileged code.
|
inlinestatic |
Enable memory protection.
This routine enables memory protection with standard memory setup for kernel purposes. This means that any privileged code has full access to memory as if no memory protection was turned on.
| int mpu_load | ( | const MPU_State * | state, |
| uint8_t | base, | ||
| uint8_t | count | ||
| ) |
Load MPU settings.
Loads MPU settings for default amount of regions from off-CPU buffer. This is suitable for store-resume during task switching.
| hosted_state | MPU state buffer for the current host process |
| parent_state | MPU state buffer for the parent process |
| int mpu_set_region | ( | uint8_t | region, |
| const void * | base, | ||
| uint32_t | size, | ||
| uint8_t | cls | ||
| ) |
Configure and activate MPU region.
Activate given memory region with new base address and size. For now, caller is responsible for providing base address, which is aligned to size of block. If region is already activated, then its base address, size and flags are being overwritten.
| region | ID of region being activated (0-7) |
| base | base address of region |
| size | size of region (256B and more) |
| cls | region access class, see __MPU_flags for available access classes |
Store MPU settings.
Stores MPU settings for default amount of regions into off-CPU buffer. This is suitable for store-resume during task switching.
| hosted_state | MPU state buffer for the current host process |
| parent_state | MPU state buffer for the parent process |
|
static |
MPU region access rights for ARMv6M/ARMv7M.
This array maps CMRX access modes to ARM RASR attributes See MPU_Flags for meaning of individual indices.