arch: replace all nxsched_suspend/resume_*** with nxsched_switch_context
Build Documentation / build-html (push) Has been cancelled
Docker-Linux / push (push) Has been cancelled

Complete the missing scheduling information in some architectures

In these architectures (riscv, avr, tricor) context switching
can occur in both up_switch_context and xx_doirq

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
This commit is contained in:
guoshengyuan1
2025-09-23 10:24:02 +08:00
committed by GUIDINGLI
parent 7c01281757
commit 6a57c56925
36 changed files with 101 additions and 153 deletions
+4
View File
@@ -95,6 +95,10 @@ FAR chipreg_t *z80_doirq(uint8_t irq, FAR chipreg_t *regs)
addrenv_switch(tcb);
#endif
/* Update scheduler parameters */
nxsched_switch_context(*running_task, tcb);
/* Record the new "running" task when context switch occurred.
* g_running_tasks[] is only used by assertion logic for reporting
* crashes.
+2 -9
View File
@@ -60,10 +60,6 @@
void up_switch_context(FAR struct tcb_s *tcb, FAR struct tcb_s *rtcb)
{
/* Update scheduler parameters */
nxsched_suspend_scheduler(rtcb);
/* Are we in an interrupt handler? */
if (IN_INTERRUPT())
@@ -74,10 +70,6 @@ void up_switch_context(FAR struct tcb_s *tcb, FAR struct tcb_s *rtcb)
SAVE_IRQCONTEXT(rtcb);
/* Update scheduler parameters */
nxsched_resume_scheduler(tcb);
/* Then setup so that the context will be performed on exit
* from the interrupt. Any necessary address environment
* changes will be made when the interrupt returns.
@@ -103,9 +95,10 @@ void up_switch_context(FAR struct tcb_s *tcb, FAR struct tcb_s *rtcb)
addrenv_switch(tcb);
#endif
/* Update scheduler parameters */
nxsched_resume_scheduler(tcb);
nxsched_switch_context(rtcb, tcb);
/* Record the new "running" task */