54
54
* correct privileged Vs unprivileged linkage and placement. */
55
55
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
56
56
57
- /* Some code sections require extra critical sections when building for SMP
58
- * ( configNUMBER_OF_CORES > 1 ). */
59
- #if ( configNUMBER_OF_CORES > 1 )
60
- /* Macros that Enter/exit a critical section only when building for SMP */
61
- #define taskENTER_CRITICAL_SMP_ONLY ( pxLock ) taskENTER_CRITICAL( pxLock )
62
- #define taskEXIT_CRITICAL_SMP_ONLY ( pxLock ) taskEXIT_CRITICAL( pxLock )
63
- #define taskENTER_CRITICAL_SAFE_SMP_ONLY ( pxLock ) prvTaskEnterCriticalSafeSMPOnly( pxLock )
64
- #define taskEXIT_CRITICAL_SAFE_SMP_ONLY ( pxLock ) prvTaskExitCriticalSafeSMPOnly( pxLock )
65
-
66
- static inline __attribute__( ( always_inline ) )
67
- void prvTaskEnterCriticalSafeSMPOnly ( portMUX_TYPE * pxLock )
68
- {
69
- if ( portCHECK_IF_IN_ISR () == pdFALSE )
70
- {
71
- taskENTER_CRITICAL ( pxLock );
72
- }
73
- else
74
- {
75
- #ifdef __clang_analyzer__
76
- /* Teach clang-tidy that ISR version macro can be different */
77
- configASSERT ( 1 );
78
- #endif
79
- taskENTER_CRITICAL_ISR ( pxLock );
80
- }
81
- }
82
-
83
- static inline __attribute__( ( always_inline ) )
84
- void prvTaskExitCriticalSafeSMPOnly ( portMUX_TYPE * pxLock )
85
- {
86
- if ( portCHECK_IF_IN_ISR () == pdFALSE )
87
- {
88
- taskEXIT_CRITICAL ( pxLock );
89
- }
90
- else
91
- {
92
- #ifdef __clang_analyzer__
93
- /* Teach clang-tidy that ISR version macro can be different */
94
- configASSERT ( 1 );
95
- #endif
96
- taskEXIT_CRITICAL_ISR ( pxLock );
97
- }
98
- }
99
- #else /* configNUMBER_OF_CORES > 1 */
100
- /* Macros that Enter/exit a critical section only when building for SMP */
101
- #define taskENTER_CRITICAL_SMP_ONLY ( pxLock )
102
- #define taskEXIT_CRITICAL_SMP_ONLY ( pxLock )
103
- #define taskENTER_CRITICAL_SAFE_SMP_ONLY ( pxLock )
104
- #define taskEXIT_CRITICAL_SAFE_SMP_ONLY ( pxLock )
105
- #endif /* configNUMBER_OF_CORES > 1 */
106
-
107
57
/* Single core FreeRTOS uses queue locks to ensure that vTaskPlaceOnEventList()
108
58
* calls are deterministic (as queue locks use scheduler suspension instead of
109
59
* critical sections). However, the SMP implementation is non-deterministic
@@ -3109,7 +3059,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3109
3059
3110
3060
/* For SMP, we need to take the queue registry lock in case another
3111
3061
* core updates the register simultaneously. */
3112
- taskENTER_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3062
+ prvENTER_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3113
3063
{
3114
3064
if ( pcQueueName != NULL )
3115
3065
{
@@ -3145,7 +3095,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3145
3095
}
3146
3096
}
3147
3097
/* Release the previously taken queue registry lock. */
3148
- taskEXIT_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3098
+ prvEXIT_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3149
3099
}
3150
3100
3151
3101
#endif /* configQUEUE_REGISTRY_SIZE */
@@ -3162,7 +3112,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3162
3112
3163
3113
/* For SMP, we need to take the queue registry lock in case another
3164
3114
* core updates the register simultaneously. */
3165
- taskENTER_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3115
+ prvENTER_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3166
3116
{
3167
3117
/* Note there is nothing here to protect against another task adding or
3168
3118
* removing entries from the registry while it is being searched. */
@@ -3181,7 +3131,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3181
3131
}
3182
3132
}
3183
3133
/* Release the previously taken queue registry lock. */
3184
- taskEXIT_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3134
+ prvEXIT_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3185
3135
3186
3136
return pcReturn ;
3187
3137
} /*lint !e818 xQueue cannot be a pointer to const because it is a typedef. */
@@ -3199,7 +3149,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3199
3149
3200
3150
/* For SMP, we need to take the queue registry lock in case another
3201
3151
* core updates the register simultaneously. */
3202
- taskENTER_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3152
+ prvENTER_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3203
3153
{
3204
3154
/* See if the handle of the queue being unregistered in actually in the
3205
3155
* registry. */
@@ -3223,7 +3173,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3223
3173
}
3224
3174
}
3225
3175
/* Release the previously taken queue registry lock. */
3226
- taskEXIT_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3176
+ prvEXIT_CRITICAL_SMP_ONLY ( & xQueueRegistryLock );
3227
3177
} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */
3228
3178
3229
3179
#endif /* configQUEUE_REGISTRY_SIZE */
@@ -3247,7 +3197,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3247
3197
3248
3198
/* For SMP, we need to take the queue's xQueueLock as we are about to
3249
3199
* access the queue. */
3250
- taskENTER_CRITICAL_SMP_ONLY ( & ( pxQueue -> xQueueLock ) );
3200
+ prvENTER_CRITICAL_SMP_ONLY ( & ( pxQueue -> xQueueLock ) );
3251
3201
{
3252
3202
#if ( queueUSE_LOCKS == 1 )
3253
3203
{
@@ -3278,7 +3228,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3278
3228
#endif /* queueUSE_LOCKS == 1 */
3279
3229
}
3280
3230
/* Release the previously taken xQueueLock. */
3281
- taskEXIT_CRITICAL_SMP_ONLY ( & ( pxQueue -> xQueueLock ) );
3231
+ prvEXIT_CRITICAL_SMP_ONLY ( & ( pxQueue -> xQueueLock ) );
3282
3232
}
3283
3233
3284
3234
#endif /* configUSE_TIMERS */
@@ -3413,7 +3363,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3413
3363
3414
3364
/* In SMP, queue sets have their own xQueueLock. Thus we need to also
3415
3365
* acquire the queue set's xQueueLock before accessing it. */
3416
- taskENTER_CRITICAL_SAFE_SMP_ONLY ( & ( pxQueueSetContainer -> xQueueLock ) );
3366
+ prvENTER_CRITICAL_SAFE_SMP_ONLY ( & ( pxQueueSetContainer -> xQueueLock ) );
3417
3367
{
3418
3368
if ( pxQueueSetContainer -> uxMessagesWaiting < pxQueueSetContainer -> uxLength )
3419
3369
{
@@ -3463,7 +3413,7 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
3463
3413
}
3464
3414
}
3465
3415
/* Release the previously acquired queue set's xQueueLock. */
3466
- taskEXIT_CRITICAL_SAFE_SMP_ONLY ( & ( pxQueueSetContainer -> xQueueLock ) );
3416
+ prvEXIT_CRITICAL_SAFE_SMP_ONLY ( & ( pxQueueSetContainer -> xQueueLock ) );
3467
3417
3468
3418
return xReturn ;
3469
3419
}
0 commit comments