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 @@ -448,7 +448,7 @@ void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PR
448448 " ldr r2, [r0] \n" /* The first item in the TCB is the top of the stack. */
449449 " ldr r1, [r2] \n" /* The first item on the stack is the task's xSecureContext. */
450450 " cmp r1, #0 \n" /* Raise svc if task's xSecureContext is not NULL. */
451- " beq free_secure_context \n"
451+ " bne free_secure_context \n" /* Branch if r1 != 0. */
452452 " bx lr \n" /* There is no secure context (xSecureContext is NULL). */
453453 " free_secure_context: \n"
454454 " svc %0 \n" /* Secure context is freed in the supervisor call. */
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ vPortFreeSecureContext:
380380 ldr r2 , [ r0 ] / * The first item in the TCB is the top of the stack. * /
381381 ldr r1 , [ r2 ] / * The first item on the stack is the task's xSecureContext. * /
382382 cmp r1 , # 0 / * Raise svc if task's xSecureContext is not NULL. * /
383- beq free_secure_context
383+ bne free_secure_context / * Branch if r1 != 0 . * /
384384 bx lr / * There is no secure context (xSecureContext is NULL). * /
385385 free_secure_context:
386386 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 @@ -448,7 +448,7 @@ void vPortFreeSecureContext( uint32_t * pulTCB ) /* __attribute__ (( naked )) PR
448448 " ldr r2, [r0] \n" /* The first item in the TCB is the top of the stack. */
449449 " ldr r1, [r2] \n" /* The first item on the stack is the task's xSecureContext. */
450450 " cmp r1, #0 \n" /* Raise svc if task's xSecureContext is not NULL. */
451- " beq free_secure_context \n"
451+ " bne free_secure_context \n" /* Branch if r1 != 0. */
452452 " bx lr \n" /* There is no secure context (xSecureContext is NULL). */
453453 " free_secure_context: \n"
454454 " svc %0 \n" /* Secure context is freed in the supervisor call. */
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ vPortFreeSecureContext:
380380 ldr r2 , [ r0 ] / * The first item in the TCB is the top of the stack. * /
381381 ldr r1 , [ r2 ] / * The first item on the stack is the task's xSecureContext. * /
382382 cmp r1 , # 0 / * Raise svc if task's xSecureContext is not NULL. * /
383- beq free_secure_context
383+ bne free_secure_context / * Branch if r1 != 0 . * /
384384 bx lr / * There is no secure context (xSecureContext is NULL). * /
385385 free_secure_context:
386386 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 @@ -1216,7 +1216,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
12161216 {
12171217 -- uxCurrentNumberOfTasks ;
12181218 traceTASK_DELETE ( pxTCB );
1219- prvDeleteTCB ( pxTCB );
12201219
12211220 /* Reset the next expected unblock time in case it referred to
12221221 * the task that has just been deleted. */
@@ -1225,6 +1224,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
12251224 }
12261225 taskEXIT_CRITICAL ();
12271226
1227+ /* If the task is not deleting itself, call prvDeleteTCB from outside of
1228+ * critical section. If a task deletes itself, prvDeleteTCB is called
1229+ * from prvCheckTasksWaitingTermination which is called from Idle task. */
1230+ if ( pxTCB != pxCurrentTCB )
1231+ {
1232+ prvDeleteTCB ( pxTCB );
1233+ }
1234+
12281235 /* Force a reschedule if it is the currently running task that has just
12291236 * been deleted. */
12301237 if ( xSchedulerRunning != pdFALSE )
You can’t perform that action at this time.
0 commit comments