Skip to content

Commit 58f0d36

Browse files
authored
Export MPU Section Attributes (#931)
Export the PRIVILEGED_FUNCTION, PRIVILEGED_DATA, and FREERTOS_SYSTEM_CALL attributes to make it easier for end users to add their own privileged functions and system calls.
1 parent 93380c0 commit 58f0d36

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

include/mpu_wrappers.h

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@
229229
#define xStreamBufferReceiveCompletedFromISR MPU_xStreamBufferReceiveCompletedFromISR
230230
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
231231

232-
/* Remove the privileged function macro, but keep the PRIVILEGED_DATA
233-
* macro so applications can place data in privileged access sections
234-
* (useful when using statically allocated objects). */
235-
#define PRIVILEGED_FUNCTION
236-
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
237-
#define FREERTOS_SYSTEM_CALL
238-
239-
240232
#if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) )
241233

242234
#define vGrantAccessToTask( xTask, xTaskToGrantAccess ) vGrantAccessToKernelObject( ( xTask ), ( int32_t ) ( xTaskToGrantAccess ) )
@@ -265,15 +257,12 @@
265257

266258
#endif /* #if ( ( configUSE_MPU_WRAPPERS_V1 == 0 ) && ( configENABLE_ACCESS_CONTROL_LIST == 1 ) ) */
267259

268-
#else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
269-
270-
/* Ensure API functions go in the privileged execution section. */
271-
#define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
272-
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
273-
#define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
274-
275260
#endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
276261

262+
#define PRIVILEGED_FUNCTION __attribute__( ( section( "privileged_functions" ) ) )
263+
#define PRIVILEGED_DATA __attribute__( ( section( "privileged_data" ) ) )
264+
#define FREERTOS_SYSTEM_CALL __attribute__( ( section( "freertos_system_calls" ) ) )
265+
277266
#else /* portUSING_MPU_WRAPPERS */
278267

279268
#define PRIVILEGED_FUNCTION

0 commit comments

Comments
 (0)