File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -472,7 +472,8 @@ void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __att
472
472
" ldr r3, =%1 \n"
473
473
" cmp r2, r3 \n"
474
474
" beq system_call_exit \n"
475
- " b vPortSVCHandler_C \n"
475
+ " ldr r3, =vPortSVCHandler_C \n"
476
+ " bx r3 \n"
476
477
" \n"
477
478
" system_call_enter: \n"
478
479
" push {lr} \n"
@@ -508,11 +509,13 @@ void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __att
508
509
" \n"
509
510
" stacking_used_psp: \n"
510
511
" mrs r0, psp \n"
511
- " b vPortSVCHandler_C \n"
512
+ " ldr r3, =vPortSVCHandler_C \n"
513
+ " bx r3 \n"
512
514
" \n"
513
515
" stacking_used_msp: \n"
514
516
" mrs r0, msp \n"
515
- " b vPortSVCHandler_C \n"
517
+ " ldr r3, =vPortSVCHandler_C \n"
518
+ " bx r3 \n"
516
519
" \n"
517
520
" .align 4 \n"
518
521
);
Original file line number Diff line number Diff line change @@ -547,6 +547,20 @@ void vPortCloseRunningThread( void * pvTaskToDelete,
547
547
/* This is called from a critical section, which must be exited before the
548
548
* thread stops. */
549
549
taskEXIT_CRITICAL ();
550
+
551
+ /* Record that a yield is pending so that the next tick interrupt switches
552
+ * out this thread regardless of the value of configUSE_PREEMPTION. This is
553
+ * needed when a task deletes itself - the taskYIELD_WITHIN_API within
554
+ * vTaskDelete does not get called because this function never returns. If
555
+ * we do not pend portINTERRUPT_YIELD here, the next task is not scheduled
556
+ * when configUSE_PREEMPTION is set to 0. */
557
+ if ( pvInterruptEventMutex != NULL )
558
+ {
559
+ WaitForSingleObject ( pvInterruptEventMutex , INFINITE );
560
+ ulPendingInterrupts |= ( 1 << portINTERRUPT_YIELD );
561
+ ReleaseMutex ( pvInterruptEventMutex );
562
+ }
563
+
550
564
CloseHandle ( pxThreadState -> pvYieldEvent );
551
565
ExitThread ( 0 );
552
566
}
You can’t perform that action at this time.
0 commit comments