eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.8k stars 768 forks source link

Add WFE in tx_thread_schedule in SMP system #313

Open carll00226 opened 8 months ago

carll00226 commented 8 months ago

HI, support team: I want to add WFE when running in the loop of _tx_thread_schedule in SMP threadx system. and release SEV when task ready, would you please tell me where to add the WFE and SEV instruction?

williamelamie commented 5 months ago

The first place to look is the TX_ENABLE_WFI logic. An example can be found in the ThreadX Cortex-A5x SMP ports. The wait here is released by _tx_thread_smp_core_preempt via the macro TX_THREAD_SMP_WAKEUP_LOGIC. Of course, this logic could be modified to meet your needs.