diff --git a/arch/Kconfig b/arch/Kconfig index 0d884b691b3..41dfe5600cf 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -302,6 +302,16 @@ config GEN_SW_ISR_TABLE _isr_table_entry containing the interrupt service routine and supplied parameter. +config ARCH_SW_ISR_TABLE_ALIGN + int "Alignment size of a software ISR table" + default 0 + depends on GEN_SW_ISR_TABLE + help + This option controls alignment size of generated + _sw_isr_table. Some architecture needs a software ISR table + to be aligned to architecture specific size. The default + size is 0 for no alignment. + config GEN_IRQ_START_VECTOR int default 0 diff --git a/include/linker/common-ram.ld b/include/linker/common-ram.ld index b16adfaa539..ec462b6f07e 100644 --- a/include/linker/common-ram.ld +++ b/include/linker/common-ram.ld @@ -8,6 +8,12 @@ #if defined(CONFIG_GEN_ISR_TABLES) && defined(CONFIG_DYNAMIC_INTERRUPTS) SECTION_DATA_PROLOGUE(sw_isr_table,,) { + /* + * Some arch requires an entry to be aligned to arch + * specific boundary for using double word load + * instruction. See include/sw_isr_table.h. + */ + . = ALIGN(CONFIG_ARCH_SW_ISR_TABLE_ALIGN); *(SW_ISR_TABLE) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) #endif diff --git a/include/linker/common-rom.ld b/include/linker/common-rom.ld index 71371bba22a..4c914f1bb20 100644 --- a/include/linker/common-rom.ld +++ b/include/linker/common-rom.ld @@ -3,6 +3,12 @@ #if defined(CONFIG_GEN_ISR_TABLES) && !defined(CONFIG_DYNAMIC_INTERRUPTS) SECTION_PROLOGUE(sw_isr_table,,) { + /* + * Some arch requires an entry to be aligned to arch + * specific boundary for using double word load + * instruction. See include/sw_isr_table.h. + */ + . = ALIGN(CONFIG_ARCH_SW_ISR_TABLE_ALIGN); *(SW_ISR_TABLE) } GROUP_LINK_IN(ROMABLE_REGION) #endif