Revert "irq: remove restore_critical_section in irq"

This reverts commit f6a9e9105712833c1074ffe88f8452def2e94dcf.
This commit is contained in:
Masayuki Ishikawa 2024-07-02 11:03:20 +09:00 committed by Xiang Xiao
parent 80fdf95790
commit 04c19bb1c9
13 changed files with 27 additions and 0 deletions

View File

@ -79,6 +79,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
g_running_tasks[this_cpu()] = this_task();
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -92,6 +92,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
g_running_tasks[this_cpu()] = this_task();
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -79,6 +79,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
g_running_tasks[this_cpu()] = this_task();
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -71,6 +71,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
g_running_tasks[this_cpu()] = this_task();
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -128,6 +128,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
g_running_tasks[this_cpu()] = this_task();
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -64,6 +64,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
if (regs != CURRENT_REGS)
{
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -98,6 +98,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
if (regs != CURRENT_REGS)
{
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

View File

@ -99,6 +99,9 @@ uint64_t *arm64_doirq(int irq, uint64_t * regs)
g_running_tasks[this_cpu()] = this_task();
/* Restore the cpu lock */
restore_critical_section();
regs = (uint64_t *)CURRENT_REGS;
}

View File

@ -85,6 +85,7 @@ uint32_t *ceva_doirq(int irq, uint32_t *regs)
g_running_tasks[this_cpu()] = this_task();
restore_critical_section();
regs = CURRENT_REGS;
}

View File

@ -109,6 +109,10 @@ uintreg_t *riscv_doirq(int irq, uintreg_t *regs)
g_running_tasks[this_cpu()] = this_task();
/* Restore the cpu lock */
restore_critical_section();
/* If a context switch occurred while processing the interrupt then
* CURRENT_REGS may have change value. If we return any value
* different from the input regs, then the lower level will know

View File

@ -75,6 +75,10 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb)
nxsched_resume_scheduler(tcb);
/* Restore the cpu lock */
restore_critical_section();
/* Then switch contexts */
sim_restorestate(tcb->xcp.regs);

View File

@ -118,6 +118,13 @@ uint32_t *sparc_doirq(int irq, uint32_t *regs)
regs = (uint32_t *)((uint32_t)CURRENT_REGS -
CPU_MINIMUM_STACK_FRAME_SIZE);
/* Restore the cpu lock */
if (regs != CURRENT_REGS)
{
restore_critical_section();
}
/* Set CURRENT_REGS to NULL to indicate that we are no longer in an
* interrupt handler.
*/

View File

@ -94,6 +94,7 @@ uint32_t *xtensa_irq_dispatch(int irq, uint32_t *regs)
if (regs != CURRENT_REGS)
{
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}