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
449449 " ldr r2, [r0] \n" /* The first item in the TCB is the top of the stack. */
450450 " ldr r1, [r2] \n" /* The first item on the stack is the task's xSecureContext. */
451451 " 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. */
453453 " bx lr \n" /* There is no secure context (xSecureContext is NULL). */
454454 " free_secure_context: \n"
455455 " 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:
381381 ldr r2 , [ r0 ] / * The first item in the TCB is the top of the stack. * /
382382 ldr r1 , [ r2 ] / * The first item on the stack is the task's xSecureContext. * /
383383 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 . * /
385385 bx lr / * There is no secure context (xSecureContext is NULL). * /
386386 free_secure_context:
387387 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
449449 " ldr r2, [r0] \n" /* The first item in the TCB is the top of the stack. */
450450 " ldr r1, [r2] \n" /* The first item on the stack is the task's xSecureContext. */
451451 " 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. */
453453 " bx lr \n" /* There is no secure context (xSecureContext is NULL). */
454454 " free_secure_context: \n"
455455 " 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:
381381 ldr r2 , [ r0 ] / * The first item in the TCB is the top of the stack. * /
382382 ldr r1 , [ r2 ] / * The first item on the stack is the task's xSecureContext. * /
383383 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 . * /
385385 bx lr / * There is no secure context (xSecureContext is NULL). * /
386386 free_secure_context:
387387 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 )
12191219 {
12201220 -- uxCurrentNumberOfTasks ;
12211221 traceTASK_DELETE ( pxTCB );
1222- prvDeleteTCB ( pxTCB );
12231222
12241223 /* Reset the next expected unblock time in case it referred to
12251224 * the task that has just been deleted. */
@@ -1228,6 +1227,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
12281227 }
12291228 taskEXIT_CRITICAL ();
12301229
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+
12311238 /* Force a reschedule if it is the currently running task that has just
12321239 * been deleted. */
12331240 if ( xSchedulerRunning != pdFALSE )
You can’t perform that action at this time.
0 commit comments