Skip to content

Commit 8a1799f

Browse files
change(freertos/smp): Update tasks.c locking
Replaced critical section macros with data group locking macros such as taskENTER/EXIT_CRITICAL() with taskLOCK/UNLOCK_KERNEL_DATA_GROUP(). Some tasks.c API relied on their callers to enter critical sections. This assumption no longer works under granular locking. Critical sections added to the following functions: - `vTaskInternalSetTimeOutState()` - `xTaskIncrementTick()` - `vTaskSwitchContext()` - `xTaskRemoveFromEventList()` - `vTaskInternalSetTimeOutState()` - `eTaskConfirmSleepModeStatus()` - `xTaskPriorityDisinherit()` - `pvTaskIncrementMutexHeldCount()` Added missing suspensions to the following functions: - `vTaskPlaceOnEventList()` - `vTaskPlaceOnUnorderedEventList()` - `vTaskPlaceOnEventListRestricted()` Fixed the locking in vTaskSwitchContext() vTaskSwitchContext() must aquire both kernel locks, viz., task lock and ISR lock. This is because, vTaskSwitchContext() can be called from either task context or ISR context. Also, vTaskSwitchContext() must not alter the interrupt state prematurely. Co-authored-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
1 parent 56d0e10 commit 8a1799f

File tree

1 file changed

+515
-229
lines changed

1 file changed

+515
-229
lines changed

0 commit comments

Comments
 (0)