arch: arm: mpu: enable WBWA caching on per thread user RAM
Update _get_region_attr_by_type used to set up the user regions
on a per thread basis to match the REGION_USER_RAM_ATTR macro. Caching
attributes were set "Outer and inner write-through. No write allocate.",
this patch changes it to "Outer and inner write-back. Write and read
allocate.".
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
diff --git a/arch/arm/core/cortex_m/mpu/arm_mpu.c b/arch/arm/core/cortex_m/mpu/arm_mpu.c
index 2316158..6e0fe6a 100644
--- a/arch/arm/core/cortex_m/mpu/arm_mpu.c
+++ b/arch/arm/core/cortex_m/mpu/arm_mpu.c
@@ -109,17 +109,17 @@
switch (type) {
#ifdef CONFIG_USERSPACE
case THREAD_STACK_REGION:
- return _get_region_attr(1, P_RW_U_RW, 0, 1, 0,
+ return _get_region_attr(1, P_RW_U_RW, 1, 1, 1,
1, 0, region_size);
#endif
#ifdef CONFIG_MPU_STACK_GUARD
case THREAD_STACK_GUARD_REGION:
- return _get_region_attr(1, P_RO_U_NA, 0, 1, 0,
+ return _get_region_attr(1, P_RO_U_NA, 1, 1, 1,
1, 0, region_size);
#endif
#ifdef CONFIG_APPLICATION_MEMORY
case THREAD_APP_DATA_REGION:
- return _get_region_attr(1, P_RW_U_RW, 0, 1, 0,
+ return _get_region_attr(1, P_RW_U_RW, 1, 1, 1,
1, 0, region_size);
#endif
default: