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

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

commit 2621005a3d39ff2aade23cf6e64305e1e2a5f41a
Author: hujun5 <[email protected]>
AuthorDate: Mon Nov 23 11:03:39 2026 +0800

    arm_a_r: Fix non-GIC interrupt dispatch support
    
    The shared IRQ dispatcher unconditionally depended on GIC definitions and 
replaced arm_ack_irq() with an empty macro for every A/R profile.  This breaks 
classic ARM targets and ARMv7-R SoCs that use a VIM instead of a GIC.
    
    Only include the GIC definitions for SMP dispatch, keep arm_ack_irq() as a 
regular chip interface, and let non-GIC controllers acknowledge interrupts in 
their decode paths.  Also make GICv2 opt-in for ARMv7-R targets.
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm/src/arm_a_r/arm_doirq.c   | 9 ++++-----
 arch/arm/src/armv7-r/Kconfig       | 2 +-
 arch/arm/src/common/arm_internal.h | 7 ++-----
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/arm/src/arm_a_r/arm_doirq.c b/arch/arm/src/arm_a_r/arm_doirq.c
index dc282269000..b9941539873 100644
--- a/arch/arm/src/arm_a_r/arm_doirq.c
+++ b/arch/arm/src/arm_a_r/arm_doirq.c
@@ -38,7 +38,10 @@
 #include <sched/sched.h>
 
 #include "arm_internal.h"
-#include "gic.h"
+
+#ifdef CONFIG_SMP
+#  include "gic.h"
+#endif
 
 /****************************************************************************
  * Public Functions
@@ -65,10 +68,6 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
 
   DEBUGASSERT(!up_interrupt_context());
 
-  /* Acknowledge the interrupt */
-
-  arm_ack_irq(irq);
-
   /* if irq == GIC_SMP_CPUSTART
    * We are initiating the multi-core jumping state to up_idle,
    * and we will use this_task(). Therefore, it cannot be overridden.
diff --git a/arch/arm/src/armv7-r/Kconfig b/arch/arm/src/armv7-r/Kconfig
index 25983ae6ff5..808c00b9128 100644
--- a/arch/arm/src/armv7-r/Kconfig
+++ b/arch/arm/src/armv7-r/Kconfig
@@ -29,7 +29,7 @@ comment "ARMv7-R Configuration Options"
 config ARMV7R_HAVE_GICv2
        bool "ARMV7R_GICv2 support"
        select ARCH_HAVE_IRQTRIGGER
-       default y
+       default n
        ---help---
                Selected by the configuration tool if the architecture supports 
the
                Generic Interrupt Controller (GIC)
diff --git a/arch/arm/src/common/arm_internal.h 
b/arch/arm/src/common/arm_internal.h
index 4cbce553775..dbe754e49c3 100644
--- a/arch/arm/src/common/arm_internal.h
+++ b/arch/arm/src/common/arm_internal.h
@@ -296,11 +296,7 @@ void weak_function arm_initialize_stack(void);
 
 /* Interrupt acknowledge and dispatch */
 
-#if defined(CONFIG_ARCH_ARMV7A) || defined(CONFIG_ARCH_ARMV7R) || 
defined(CONFIG_ARCH_ARMV8R)
-#  define arm_ack_irq(i)
-#else
 void arm_ack_irq(int irq);
-#endif
 
 uint32_t *arm_doirq(int irq, uint32_t *regs);
 
@@ -368,7 +364,6 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, 
uint32_t dfsr);
 uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr);
 uint32_t *arm_syscall(uint32_t *regs);
 uint32_t *arm_undefinedinsn(uint32_t *regs);
-bool arm_fault_kill(uint32_t *regs);
 
 /* Exception handling logic common to other ARM7 and ARM9 family. */
 
@@ -393,6 +388,8 @@ void arm_undefinedinsn(uint32_t *regs);
 
 #endif /* CONFIG_ARCH_ARMV[6-8]M */
 
+bool arm_fault_kill(uint32_t *regs);
+
 void arm_vectorundefinsn(void);
 void arm_vectorsvc(void);
 void arm_vectorprefetch(void);

Reply via email to