File tree Expand file tree Collapse file tree 5 files changed +12
-5
lines changed
ARMv8M/non_secure/portable Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PR
449
449
" ldr r2, [r0] \n" /* The first item in the TCB is the top of the stack. */
450
450
" ldr r1, [r2] \n" /* The first item on the stack is the task's xSecureContext. */
451
451
" cmp r1, #0 \n" /* Raise svc if task's xSecureContext is not NULL. */
452
- " beq free_secure_context \n"
452
+ " bne free_secure_context \n" /* Branch if r1 != 0. */
453
453
" bx lr \n" /* There is no secure context (xSecureContext is NULL). */
454
454
" free_secure_context: \n"
455
455
" svc %0 \n" /* Secure context is freed in the supervisor call. */
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ vPortFreeSecureContext:
381
381
ldr r2 , [ r0 ] / * The first item in the TCB is the top of the stack. * /
382
382
ldr r1 , [ r2 ] / * The first item on the stack is the task's xSecureContext. * /
383
383
cmp r1 , # 0 / * Raise svc if task's xSecureContext is not NULL. * /
384
- beq free_secure_context
384
+ bne free_secure_context / * Branch if r1 != 0 . * /
385
385
bx lr / * There is no secure context (xSecureContext is NULL). * /
386
386
free_secure_context:
387
387
svc 1 / * Secure context is freed in the supervisor call . portSVC_FREE_SECURE_CONTEXT = 1 . * /
Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PR
449
449
" ldr r2, [r0] \n" /* The first item in the TCB is the top of the stack. */
450
450
" ldr r1, [r2] \n" /* The first item on the stack is the task's xSecureContext. */
451
451
" cmp r1, #0 \n" /* Raise svc if task's xSecureContext is not NULL. */
452
- " beq free_secure_context \n"
452
+ " bne free_secure_context \n" /* Branch if r1 != 0. */
453
453
" bx lr \n" /* There is no secure context (xSecureContext is NULL). */
454
454
" free_secure_context: \n"
455
455
" svc %0 \n" /* Secure context is freed in the supervisor call. */
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ vPortFreeSecureContext:
381
381
ldr r2 , [ r0 ] / * The first item in the TCB is the top of the stack. * /
382
382
ldr r1 , [ r2 ] / * The first item on the stack is the task's xSecureContext. * /
383
383
cmp r1 , # 0 / * Raise svc if task's xSecureContext is not NULL. * /
384
- beq free_secure_context
384
+ bne free_secure_context / * Branch if r1 != 0 . * /
385
385
bx lr / * There is no secure context (xSecureContext is NULL). * /
386
386
free_secure_context:
387
387
svc 1 / * Secure context is freed in the supervisor call . portSVC_FREE_SECURE_CONTEXT = 1 . * /
Original file line number Diff line number Diff line change @@ -1219,7 +1219,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
1219
1219
{
1220
1220
-- uxCurrentNumberOfTasks ;
1221
1221
traceTASK_DELETE ( pxTCB );
1222
- prvDeleteTCB ( pxTCB );
1223
1222
1224
1223
/* Reset the next expected unblock time in case it referred to
1225
1224
* the task that has just been deleted. */
@@ -1228,6 +1227,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
1228
1227
}
1229
1228
taskEXIT_CRITICAL ();
1230
1229
1230
+ /* If the task is not deleting itself, call prvDeleteTCB from outside of
1231
+ * critical section. If a task deletes itself, prvDeleteTCB is called
1232
+ * from prvCheckTasksWaitingTermination which is called from Idle task. */
1233
+ if ( pxTCB != pxCurrentTCB )
1234
+ {
1235
+ prvDeleteTCB ( pxTCB );
1236
+ }
1237
+
1231
1238
/* Force a reschedule if it is the currently running task that has just
1232
1239
* been deleted. */
1233
1240
if ( xSchedulerRunning != pdFALSE )
You can’t perform that action at this time.
0 commit comments