Implements support for smaller interrupt tables as described at http://www.nuttx.org/doku.php?id=wiki:howtos:smallvectors . This is largely the work of Mark Schulte. However, I have made several changes to match with the Wiki document. If you like the change, thanks go to Marc. For any errors you can blame me.

This commit is contained in:
Gregory Nutt
2017-03-03 08:55:16 -06:00
parent eca7ae3043
commit c2b620b4f8
7 changed files with 134 additions and 15 deletions

View File

@@ -43,11 +43,29 @@
#include "irq/irq.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* This is the number of entries in the interrupt vector table */
#ifdef CONFIG_ARCH_MINIMAL_VECTORTABLE
# define TAB_SIZE CONFIG_ARCH_NUSER_INTERRUPTS
#else
# define TAB_SIZE NR_IRQS
#endif
/****************************************************************************
* Public Data
****************************************************************************/
struct irq g_irqvector[NR_IRQS];
/* This is the interrupt vector table */
#ifdef CONFIG_ARCH_MINIMAL_VECTORTABLE
struct irq_info_s g_irqvector[CONFIG_ARCH_NUSER_INTERRUPTS];
#else
struct irq_info_s g_irqvector[NR_IRQS];
#endif
/****************************************************************************
* Public Functions
@@ -67,7 +85,7 @@ void irq_initialize(void)
/* Point all interrupt vectors to the unexpected interrupt */
for (i = 0; i < NR_IRQS; i++)
for (i = 0; i < TAB_SIZE; i++)
{
g_irqvector[i].handler = irq_unexpected_isr;
g_irqvector[i].arg = NULL;