irq: remove restore_critical_section in irq
Only in the non-critical region, nuttx can the respond to the irq and not hold the lock When returning from the irq, there is no need to check whether the lock needs to be restored test: We can use qemu for testing. compiling make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20 running qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
7445c97c77
commit
f6a9e91057
|
@ -79,7 +79,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
g_running_tasks[this_cpu()] = this_task();
|
||||
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
g_running_tasks[this_cpu()] = this_task();
|
||||
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
g_running_tasks[this_cpu()] = this_task();
|
||||
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
g_running_tasks[this_cpu()] = this_task();
|
||||
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
g_running_tasks[this_cpu()] = this_task();
|
||||
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
if (regs != CURRENT_REGS)
|
||||
{
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
|
|||
|
||||
if (regs != CURRENT_REGS)
|
||||
{
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,9 +99,6 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ uint32_t *ceva_doirq(int irq, uint32_t *regs)
|
|||
|
||||
g_running_tasks[this_cpu()] = this_task();
|
||||
|
||||
restore_critical_section();
|
||||
regs = CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,10 +109,6 @@ 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
|
||||
|
|
|
@ -75,10 +75,6 @@ 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);
|
||||
|
|
|
@ -118,13 +118,6 @@ 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.
|
||||
*/
|
||||
|
|
|
@ -94,7 +94,6 @@ uint32_t *xtensa_irq_dispatch(int irq, uint32_t *regs)
|
|||
|
||||
if (regs != CURRENT_REGS)
|
||||
{
|
||||
restore_critical_section();
|
||||
regs = (uint32_t *)CURRENT_REGS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue