This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ea4c4ef36a arm/armv8-r: fix unable to switch context in ISR context
ea4c4ef36a is described below

commit ea4c4ef36a8b6481268ea62638a69a0175dda624
Author: chao an <[email protected]>
AuthorDate: Thu Oct 24 19:43:16 2024 +0800

    arm/armv8-r: fix unable to switch context in ISR context
    
    Regression by:
    | commit 35c8c80a00a99ff0e19d51eaa74165bd830a36f8
    | Author: ligd <[email protected]>
    | Date:   Fri Jul 26 23:14:13 2024 +0800
    |
    | arch: change nxsched_suspend/resume_scheduler() called position
    
    Signed-off-by: chao an <[email protected]>
---
 arch/arm/src/armv8-r/arm_doirq.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/armv8-r/arm_doirq.c b/arch/arm/src/armv8-r/arm_doirq.c
index 98c5dc4bc2..af47bc641d 100644
--- a/arch/arm/src/armv8-r/arm_doirq.c
+++ b/arch/arm/src/armv8-r/arm_doirq.c
@@ -58,7 +58,9 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
    * and we will use this_task(). Therefore, it cannot be overridden.
    */
 
+#ifdef CONFIG_SMP
   if (irq != GIC_SMP_CPUSTART)
+#endif
     {
       tcb->xcp.regs = regs;
     }
@@ -72,11 +74,10 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
   /* Deliver the IRQ */
 
   irq_dispatch(irq, regs);
+  tcb = this_task();
 
   if (regs != tcb->xcp.regs)
     {
-      tcb = this_task();
-
       /* Update scheduler parameters */
 
       nxsched_suspend_scheduler(g_running_tasks[this_cpu()]);
@@ -87,7 +88,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
        * crashes.
        */
 
-      g_running_tasks[this_cpu()] = this_task();
+      g_running_tasks[this_cpu()] = tcb;
       regs = tcb->xcp.regs;
     }
 

Reply via email to