isr_tables: Support hardware interrupt vector table-only configuration.

The existing isr_tables implementation does not allow enabling only
hardware interrupt vector table without software isr table.

This commit ensures that CONFIG_GEN_IRQ_VECTOR_TABLE can be used
without setting CONFIG_GEN_SW_ISR_TABLE.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2019-10-14 13:47:17 +09:00 committed by Ioannis Glaropoulos
commit e816ac7124
3 changed files with 19 additions and 8 deletions

View file

@ -29,20 +29,31 @@ Z_GENERIC_SECTION(.irq_info) struct int_list_header _iheader = {
/* These are placeholder tables. They will be replaced by the real tables
* generated by gen_isr_tables.py.
*
* z_irq_spurious and _isr_wrapper are used as placeholder values to
* ensure that they are not optimized out in the first link. The first
* link must contain the same symbols as the second one for the code
* generation to work.
* z_irq_spurious is used as a placeholder value to ensure that it is not
* optimized out in the first linker pass. The first linker pass must contain
* the same symbols as the second linker pass for the code generation to work.
*/
/* Some arches don't use a vector table, they have a common exception entry
* point for all interrupts. Don't generate a table in this case.
*/
#ifdef CONFIG_GEN_IRQ_VECTOR_TABLE
/* When both the IRQ vector table and the software ISR table are used, populate
* the IRQ vector table with the common software ISR by default, such that all
* indirect interrupt vectors are handled using the software ISR table;
* otherwise, populate the IRQ vector table with z_irq_spurious so that all
* un-connected IRQ vectors end up in the spurious IRQ handler.
*/
#ifdef CONFIG_GEN_SW_ISR_TABLE
#define IRQ_VECTOR_TABLE_DEFAULT_ISR _isr_wrapper
#else
#define IRQ_VECTOR_TABLE_DEFAULT_ISR z_irq_spurious
#endif /* CONFIG_GEN_SW_ISR_TABLE */
u32_t __irq_vector_table _irq_vector_table[IRQ_TABLE_SIZE] = {
[0 ...(IRQ_TABLE_SIZE - 1)] = (u32_t)&_isr_wrapper,
[0 ...(IRQ_TABLE_SIZE - 1)] = (u32_t)&IRQ_VECTOR_TABLE_DEFAULT_ISR,
};
#endif
#endif /* CONFIG_GEN_IRQ_VECTOR_TABLE */
/* If there are no interrupts at all, or all interrupts are of the 'direct'
* type and bypass the _sw_isr_table, then do not generate one.

View file

@ -5,7 +5,7 @@
DEVICE_INIT_SECTIONS()
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#if defined(CONFIG_GEN_ISR_TABLES) && defined(CONFIG_DYNAMIC_INTERRUPTS)
#if defined(CONFIG_GEN_SW_ISR_TABLE) && defined(CONFIG_DYNAMIC_INTERRUPTS)
SECTION_DATA_PROLOGUE(sw_isr_table,,)
{
/*

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
#if defined(CONFIG_GEN_ISR_TABLES) && !defined(CONFIG_DYNAMIC_INTERRUPTS)
#if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_DYNAMIC_INTERRUPTS)
SECTION_PROLOGUE(sw_isr_table,,)
{
/*