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
+38
View File
@@ -621,6 +621,44 @@ config ARCH_RAMVECTORS
If ARCH_RAMVECTORS is defined, then the architecture will support
modifiable vectors in a RAM-based vector table.
config ARCH_MINIMAL_VECTORTABLE
bool "Minimal RAM usage for vector table"
default n
---help---
Use a minimum amount of RAM for the vector table.
Instead of allowing irq_attach() to work for all interrupt vectors,
restrict to only working for a select few (defined in your board
configuration). This can dramatically reduce the amount of RAM used
be your vector table.
To use this setting, you must have a file in your board config that
provides:
#include <nuttx/arch.h>
const irq_t g_irqmap[NR_IRQS] =
{
... IRQ to index mapping values ...
};
This table is index by the hardware IRQ number and provides a value
in the range of 0 to CONFIG_ARCH_NUSER_INTERRUPTS that the new,
mapped index into the vector table. Unused, unmapped interrupts
should be set to (irq_t)-1. So, for example, if g_irqmap[37] == 24,
Then the hardware interrupt vector 37 will be mapped to the interrupt
vector table at index 24. if g_irqmap[42] == (irq_t)-1, then hardware
interrupt vector 42 is not used and if it occurs will result in an
unexpected interrupt crash.
config ARCH_NUSER_INTERRUPTS
int "Number of interrupts"
default 0
depends on ARCH_MINIMAL_VECTORTABLE
---help---
If CONFIG_ARCH_MINIMAL_VECTORTABLE is defined, then this setting
defines the actual number of valid, mapped interrupts in g_irqmap.
This number will be the new size of the OS vector table
comment "Board Settings"
config BOARD_LOOPSPERMSEC