sw_isr_table.h: clean up definition

This private data structure now no longer introduces a typedef or
uses CamelCase. It's not necessary to specify the size of extern
arrays, so we don't need a block of #ifdefs for every arch.

Change-Id: I71fe61822ecef29820280a43d5ac2822a61f7082
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-01-25 14:32:53 -08:00
commit 164ba8c5cd
6 changed files with 26 additions and 31 deletions

View file

@ -77,7 +77,7 @@ void _enter_irq(uint32_t ipending)
#endif #endif
while (ipending) { while (ipending) {
_IsrTableEntry_t *ite; struct _isr_table_entry *ite;
#ifdef CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT #ifdef CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT
_sys_k_event_logger_interrupt(); _sys_k_event_logger_interrupt();

View file

@ -62,10 +62,10 @@ extern void _irq_priority_set(unsigned int irq, unsigned int prio,
* accept constant values for the irq_p parameter, very important as the * accept constant values for the irq_p parameter, very important as the
* numerical IRQ line is used to create a named section. * numerical IRQ line is used to create a named section.
* *
* 2. An instance of _IsrTableEntry is created containing the ISR and its * 2. An instance of struct _isr_table_entry is created containing the ISR and
* parameter. If you look at how _sw_isr_table is created, each entry in the * its parameter. If you look at how _sw_isr_table is created, each entry in
* array is in its own section named by the IRQ line number. What we are doing * the array is in its own section named by the IRQ line number. What we are
* here is to override one of the default entries (which points to the * doing here is to override one of the default entries (which points to the
* spurious IRQ handler) with what was supplied here. * spurious IRQ handler) with what was supplied here.
* *
* 3. The priority level for the interrupt is configured by a call to * 3. The priority level for the interrupt is configured by a call to
@ -82,7 +82,7 @@ extern void _irq_priority_set(unsigned int irq, unsigned int prio,
#define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \ #define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
({ \ ({ \
enum { IRQ = irq_p }; \ enum { IRQ = irq_p }; \
static struct _IsrTableEntry _CONCAT(_isr_irq, irq_p) \ static struct _isr_table_entry _CONCAT(_isr_irq, irq_p) \
__attribute__ ((used)) \ __attribute__ ((used)) \
__attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \ __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
{isr_param_p, isr_p}; \ {isr_param_p, isr_p}; \

View file

@ -68,10 +68,10 @@ extern void _irq_priority_set(unsigned int irq, unsigned int prio,
* accept constant values for the irq_p parameter, very important as the * accept constant values for the irq_p parameter, very important as the
* numerical IRQ line is used to create a named section. * numerical IRQ line is used to create a named section.
* *
* 2. An instance of _IsrTableEntry is created containing the ISR and its * 2. An instance of struct _isr_table_entry is created containing the ISR and
* parameter. If you look at how _sw_isr_table is created, each entry in the * its parameter. If you look at how _sw_isr_table is created, each entry in
* array is in its own section named by the IRQ line number. What we are doing * the array is in its own section named by the IRQ line number. What we are
* here is to override one of the default entries (which points to the * doing here is to override one of the default entries (which points to the
* spurious IRQ handler) with what was supplied here. * spurious IRQ handler) with what was supplied here.
* *
* 3. The priority level for the interrupt is configured by a call to * 3. The priority level for the interrupt is configured by a call to
@ -88,7 +88,7 @@ extern void _irq_priority_set(unsigned int irq, unsigned int prio,
#define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \ #define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
({ \ ({ \
enum { IRQ = irq_p }; \ enum { IRQ = irq_p }; \
static struct _IsrTableEntry _CONCAT(_isr_irq, irq_p) \ static struct _isr_table_entry _CONCAT(_isr_irq, irq_p) \
__attribute__ ((used)) \ __attribute__ ((used)) \
__attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \ __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
{isr_param_p, isr_p}; \ {isr_param_p, isr_p}; \

View file

@ -55,10 +55,10 @@ typedef unsigned int vaddr_t;
* accept constant values for the irq_p parameter, very important as the * accept constant values for the irq_p parameter, very important as the
* numerical IRQ line is used to create a named section. * numerical IRQ line is used to create a named section.
* *
* 2. An instance of _IsrTableEntry is created containing the ISR and its * 2. An instance of struct _isr_table_entry is created containing the ISR and
* parameter. If you look at how _sw_isr_table is created, each entry in the * its parameter. If you look at how _sw_isr_table is created, each entry in
* array is in its own section named by the IRQ line number. What we are doing * the array is in its own section named by the IRQ line number. What we are
* here is to override one of the default entries (which points to the * doing here is to override one of the default entries (which points to the
* spurious IRQ handler) with what was supplied here. * spurious IRQ handler) with what was supplied here.
* *
* There is no notion of priority with the Nios II internal interrupt * There is no notion of priority with the Nios II internal interrupt
@ -75,7 +75,7 @@ typedef unsigned int vaddr_t;
#define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \ #define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
({ \ ({ \
enum { IRQ = irq_p }; \ enum { IRQ = irq_p }; \
static struct _IsrTableEntry _CONCAT(_isr_irq, irq_p) \ static struct _isr_table_entry _CONCAT(_isr_irq, irq_p) \
__attribute__ ((used)) \ __attribute__ ((used)) \
__attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \ __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
{isr_param_p, isr_p}; \ {isr_param_p, isr_p}; \

View file

@ -69,10 +69,10 @@ int _arch_irq_is_enabled(unsigned int irq);
* accept constant values for the irq_p parameter, very important as the * accept constant values for the irq_p parameter, very important as the
* numerical IRQ line is used to create a named section. * numerical IRQ line is used to create a named section.
* *
* 2. An instance of _IsrTableEntry is created containing the ISR and its * 2. An instance of struct _isr_table_entry is created containing the ISR and
* parameter. If you look at how _sw_isr_table is created, each entry in the * its parameter. If you look at how _sw_isr_table is created, each entry in
* array is in its own section named by the IRQ line number. What we are doing * the array is in its own section named by the IRQ line number. What we are
* here is to override one of the default entries (which points to the * doing here is to override one of the default entries (which points to the
* spurious IRQ handler) with what was supplied here. * spurious IRQ handler) with what was supplied here.
* *
* 3. interrupt priority is not supported by pulpino core * 3. interrupt priority is not supported by pulpino core
@ -88,7 +88,7 @@ int _arch_irq_is_enabled(unsigned int irq);
#define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \ #define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
({ \ ({ \
enum { IRQ = irq_p }; \ enum { IRQ = irq_p }; \
static struct _IsrTableEntry _CONCAT(_isr_irq, irq_p) \ static struct _isr_table_entry _CONCAT(_isr_irq, irq_p) \
__attribute__ ((used)) \ __attribute__ ((used)) \
__attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \ __attribute__ ((section(STRINGIFY(_CONCAT(.gnu.linkonce.isr_irq, irq_p))))) = \
{isr_param_p, isr_p}; \ {isr_param_p, isr_p}; \

View file

@ -26,20 +26,15 @@ extern "C" {
* loaded arg -> r0, isr -> r3 in _isr_wrapper with one ldmia instruction, * loaded arg -> r0, isr -> r3 in _isr_wrapper with one ldmia instruction,
* on ARM Cortex-M (Thumb2). * on ARM Cortex-M (Thumb2).
*/ */
struct _IsrTableEntry { struct _isr_table_entry {
void *arg; void *arg;
void (*isr)(void *); void (*isr)(void *);
}; };
typedef struct _IsrTableEntry _IsrTableEntry_t; /* The software ISR table itself, an array of these structures indexed by the
* irq line
#ifdef CONFIG_ARC */
extern _IsrTableEntry_t _sw_isr_table[CONFIG_NUM_IRQS - 16]; extern struct _isr_table_entry _sw_isr_table[];
#elif CONFIG_NIOS2
extern _IsrTableEntry_t _sw_isr_table[NIOS2_NIRQ];
#else
extern _IsrTableEntry_t _sw_isr_table[CONFIG_NUM_IRQS];
#endif
#endif /* _ASMLANGUAGE */ #endif /* _ASMLANGUAGE */