mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
arch: replace all nxsched_suspend/resume_*** with nxsched_switch_context
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:
@@ -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.
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user