px4-firmware/nuttx-patches/00010-REJECTED-no-irq-args....

61 lines
1.9 KiB
Diff

diff --git NuttX/nuttx/sched/irq/irq.h NuttX/nuttx/sched/irq/irq.h
index ffb6e98..f01318b 100644
--- NuttX/nuttx/sched/irq/irq.h
+++ NuttX/nuttx/sched/irq/irq.h
@@ -72,7 +72,9 @@
struct irq_info_s
{
xcpt_t handler; /* Address of the interrupt handler */
+#if !defined(CONFIG_NOIRQARGS)
FAR void *arg; /* The argument provided to the interrupt handler. */
+#endif
};
/****************************************************************************
diff --git NuttX/nuttx/sched/irq/irq_attach.c NuttX/nuttx/sched/irq/irq_attach.c
index 9d45d9c..3707906 100644
--- NuttX/nuttx/sched/irq/irq_attach.c
+++ NuttX/nuttx/sched/irq/irq_attach.c
@@ -112,7 +112,11 @@ int irq_attach(int irq, xcpt_t isr, FAR void *arg)
/* Save the new ISR and its argument in the table. */
g_irqvector[ndx].handler = isr;
+#if defined(CONFIG_NOIRQARGS)
+ ASSERT(arg == NULL);
+#else
g_irqvector[ndx].arg = arg;
+#endif
leave_critical_section(flags);
ret = OK;
diff --git NuttX/nuttx/sched/irq/irq_dispatch.c NuttX/nuttx/sched/irq/irq_dispatch.c
index b507c06..66cb1fe 100644
--- NuttX/nuttx/sched/irq/irq_dispatch.c
+++ NuttX/nuttx/sched/irq/irq_dispatch.c
@@ -88,7 +88,11 @@ void irq_dispatch(int irq, FAR void *context)
}
#else
vector = g_irqvector[irq].handler;
- arg = g_irqvector[irq].arg;
+# if defined(CONFIG_NOIRQARGS)
+ arg = NULL;
+# else
+ arg = g_irqvector[irq].arg;
+# endif
#endif
}
diff --git NuttX/nuttx/sched/irq/irq_initialize.c NuttX/nuttx/sched/irq/irq_initialize.c
index 18bbafc..2018788 100644
--- NuttX/nuttx/sched/irq/irq_initialize.c
+++ NuttX/nuttx/sched/irq/irq_initialize.c
@@ -88,6 +88,8 @@ void irq_initialize(void)
for (i = 0; i < TAB_SIZE; i++)
{
g_irqvector[i].handler = irq_unexpected_isr;
+#if !defined(CONFIG_NOIRQARGS)
g_irqvector[i].arg = NULL;
+#endif
}
}