Skip to content
Permalink
Browse files

linker: Make alignment size for sw_isr_table configurable

sw_isr_table has two entries, an argument and an ISR function.  The
comment on struct _isr_table_entry in include/sw_isr_table.h says that
"This allows a table entry to be loaded [...] with one ldmia
instruction, on ARM [...]".  Some arch, e.g. SPARC, also has a double
word load instruction, "ldd", but the instruct must have address align
to double word or 8 bytes.

This commit makes the table alignment configurable.  It allows each
architecture to specify it, if needed.  The default value is 0 for no
alignment.

Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
  • Loading branch information...
yashi authored and andrewboie committed Jun 20, 2019
1 parent 7f94e71 commit 51bc0a065c7e7ba5b811e9c4400087fbfcba6516
Showing with 22 additions and 0 deletions.
  1. +10 −0 arch/Kconfig
  2. +6 −0 include/linker/common-ram.ld
  3. +6 −0 include/linker/common-rom.ld
@@ -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
@@ -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
@@ -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

0 comments on commit 51bc0a0

Please sign in to comment.
You can’t perform that action at this time.