kernel: expose k_mem_partition_attr_t outside User mode
This commit exposes k_mem_partition_attr_t outside User Mode, so we can use struct k_mem_partition for defining memory partitions outside the scope of user space (for example, to describe thread stack guards or no-cacheable MPU regions). A requirement is that the Zephyr build supports Memory protection. To signify this, a new hidden, all-architecture Kconfig symbol is defined (MPU). In the wake of exposing k_mem_partition_attr_t, the commit exposes the MPU architecture-specific access permission attribute macros outside the User space context (for all ARCHs), so they can be used in a more generic way. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
parent
ccf813c22a
commit
39bf24a9bd
10 changed files with 18 additions and 13 deletions
|
@ -252,7 +252,7 @@ extern "C" {
|
|||
#define _ARCH_THREAD_STACK_BUFFER(sym) \
|
||||
((char *)(sym) + MPU_GUARD_ALIGN_AND_SIZE)
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
#ifdef CONFIG_ARM_MPU
|
||||
#ifdef CONFIG_CPU_HAS_ARM_MPU
|
||||
#ifndef _ASMLANGUAGE
|
||||
#include <arch/arm/cortex_m/mpu/arm_mpu.h>
|
||||
|
@ -323,8 +323,8 @@ extern "C" {
|
|||
" and greater than or equal to minimum MPU region size." \
|
||||
"start address of the partition must align with minimum MPU \
|
||||
region size.")
|
||||
#endif /* CONFIG_CPU_HAS_ARM_MPU */
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
#endif /* CONFIG_CPU_HAS_NXP_MPU */
|
||||
#endif /* CONFIG_ARM_MPU */
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
/* Typedef for the k_mem_partition attribute*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue