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

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

commit 4ecb6efee8beaf290453af9d45353ee96f8f9359
Author: hujun5 <[email protected]>
AuthorDate: Mon Sep 23 09:24:53 2024 +0800

    arm: tc32 nested interrupts are not supported
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm/src/tlsr82/tc32/tc32_doirq.c | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/arch/arm/src/tlsr82/tc32/tc32_doirq.c 
b/arch/arm/src/tlsr82/tc32/tc32_doirq.c
index aa301a3669..8dd0abb66a 100644
--- a/arch/arm/src/tlsr82/tc32/tc32_doirq.c
+++ b/arch/arm/src/tlsr82/tc32/tc32_doirq.c
@@ -64,21 +64,15 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
   PANIC();
 #else
 
-  /* Nested interrupts are not supported in this implementation.  If you
-   * want to implement nested interrupts, you would have to (1) change the
-   * way that current_regs is handled and (2) the design associated with
-   * CONFIG_ARCH_INTERRUPTSTACK.
-   */
+  /* Nested interrupts are not supported */
+
+  DEBUGASSERT(up_current_regs() == NULL);
 
   /* Current regs non-zero indicates that we are processing an interrupt;
    * current_regs is also used to manage interrupt level context switches.
    */
 
-  if (up_current_regs() == NULL)
-    {
-      up_set_current_regs(regs);
-      regs         = NULL;
-    }
+  up_set_current_regs(regs);
 
   tcb->xcp.regs = regs;
 
@@ -97,17 +91,15 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
    * switch occurred during interrupt processing.
    */
 
-  if (regs == NULL)
+  if (regs != tcb->xcp.regs)
     {
-      if (regs != tcb->xcp.regs)
-        {
-          regs = tcb->xcp.regs;
-        }
+      regs = tcb->xcp.regs;
+    }
 
-      /* Update the current_regs to NULL. */
+  /* Update the current_regs to NULL. */
+
+  up_set_current_regs(NULL);
 
-      up_set_current_regs(NULL);
-    }
 #endif
 
   board_autoled_off(LED_INIRQ);

Reply via email to