From 3da199c71d8eb793ac8b1298a937215765b3bb64 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 22 Aug 2023 11:00:20 +0200 Subject: [PATCH] armv8-m/mpu.h: add macro to configure shared memory region --- arch/arm/src/armv8-m/mpu.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/src/armv8-m/mpu.h b/arch/arm/src/armv8-m/mpu.h index b6bf1e95d7..077eb52a07 100644 --- a/arch/arm/src/armv8-m/mpu.h +++ b/arch/arm/src/armv8-m/mpu.h @@ -351,6 +351,25 @@ void mpu_configure_region(uintptr_t base, size_t size, MPU_RLAR_PXN); \ } while (0) +/**************************************************************************** + * Name: mpu_priv_shmem + * + * Description: + * Configure a region as privileged shared memory + * + ****************************************************************************/ + +#define mpu_priv_shmem(base, size) \ + do \ + { \ + /* The configure the region */ \ + mpu_configure_region(base, size, \ + MPU_RBAR_AP_RWNO, \ + MPU_RLAR_NONCACHEABLE | \ + MPU_RBAR_SH_INNER | \ + MPU_RLAR_PXN); \ + } while (0) + /**************************************************************************** * Name: mpu_user_extsram *