Skip to content

Commit 8fcc4ab

Browse files
committed
Optional PRIVILEGED_DATA wrapper (FreeRTOS#1433)
- 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. Cherry pick + merge required to maintain submodule pointers.
1 parent af297f0 commit 8fcc4ab

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

include/mpu_wrappers.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,19 @@
280280
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
281281
#define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
282282

283-
#elif ( defined portMOVE_PRIVILEGED_DATA )
283+
#else /* portUSING_MPU_WRAPPERS */
284284

285-
#define PRIVILEGED_FUNCTION
286-
#define PRIVILEGED_DATA portMOVE_PRIVILEGED_DATA
287-
#define FREERTOS_SYSTEM_CALL
285+
#ifndef PRIVILEGED_FUNCTION
286+
#define PRIVILEGED_FUNCTION
287+
#endif
288288

289-
#else /* portUSING_MPU_WRAPPERS */
289+
#ifndef PRIVILEGED_DATA
290+
#define PRIVILEGED_DATA
291+
#endif
290292

291-
#define PRIVILEGED_FUNCTION
292-
#define PRIVILEGED_DATA
293-
#define FREERTOS_SYSTEM_CALL
293+
#ifndef FREERTOS_SYSTEM_CALL
294+
#define FREERTOS_SYSTEM_CALL
295+
#endif
294296

295297
#endif /* portUSING_MPU_WRAPPERS */
296298

0 commit comments

Comments
 (0)