From 1badc974bcf55670b312361b6fff307a04637f29 Mon Sep 17 00:00:00 2001 From: Ian Thompson Date: Mon, 17 Aug 2026 14:30:57 -0700 Subject: [PATCH] Remove MPU wrapper macro for moving PRIVILEGED_DATA - Instead, when MPU wrappers are not used, allow port to override PRIVILEGED_FUNCTION, PRIVILEGED_DATA, or FREERTOS_SYSTEM_CALL selectively, permitting custom section placement at link-time. - Allows critical data to be placed in port-specific location for improved performance, notably for cache-coherent SMP. - Does not require enabling the full MPU wrappers. Signed-off-by: Ian Thompson --- include/mpu_wrappers.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/mpu_wrappers.h b/include/mpu_wrappers.h index 8cfe9da72..69e6cbb40 100644 --- a/include/mpu_wrappers.h +++ b/include/mpu_wrappers.h @@ -284,17 +284,19 @@ #define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) ) #define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) ) -#elif ( defined portMOVE_PRIVILEGED_DATA ) - - #define PRIVILEGED_FUNCTION - #define PRIVILEGED_DATA portMOVE_PRIVILEGED_DATA - #define FREERTOS_SYSTEM_CALL - #else /* portUSING_MPU_WRAPPERS */ - #define PRIVILEGED_FUNCTION - #define PRIVILEGED_DATA - #define FREERTOS_SYSTEM_CALL + #ifndef PRIVILEGED_FUNCTION + #define PRIVILEGED_FUNCTION + #endif + + #ifndef PRIVILEGED_DATA + #define PRIVILEGED_DATA + #endif + + #ifndef FREERTOS_SYSTEM_CALL + #define FREERTOS_SYSTEM_CALL + #endif #endif /* portUSING_MPU_WRAPPERS */