Skip to content

Commit fcb6a1f

Browse files
arch: split dynamic interrupt symbol
This commit introduces the SRAM_SW_ISR_TABLE option which is selected by DYNAMIC_INTERRUPT. It allows splitting the DYNAMIC_INTERRUPT option into two parts: - One for the relocation of the ISR vector table in RAM - One for the inclusion of functions needed to install ISRs dynamically The goal is to later only select the relocation of the ISR vector table in RAM and not all the associated functions from the dynamic interrupt mechanism. Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
1 parent f2c37c4 commit fcb6a1f

File tree

9 files changed

+17
-6
lines changed

9 files changed

+17
-6
lines changed

arch/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ config ISR_TABLES_LOCAL_DECLARATION
470470

471471
config DYNAMIC_INTERRUPTS
472472
bool "Installation of IRQs at runtime"
473+
select SRAM_SW_ISR_TABLE
473474
help
474475
Enable installation of interrupts at runtime, which will move some
475476
interrupt-related data structures to RAM instead of ROM, and
@@ -596,6 +597,12 @@ config SRAM_VECTOR_TABLE
596597
When XiP is enabled, this option will result in the vector table being
597598
relocated from Flash to SRAM.
598599

600+
config SRAM_SW_ISR_TABLE
601+
bool "Place the software ISR table in SRAM instead of flash"
602+
help
603+
The option specifies that the software interrupts vector table will be
604+
placed inside SRAM instead of the flash.
605+
599606
config IRQ_OFFLOAD_NESTED
600607
bool "irq_offload() supports nested IRQs"
601608
depends on IRQ_OFFLOAD

arch/arm/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ zephyr_linker_sources(ROM_START SORT_KEY 0x1vectors cortex_m/vector_table_pad.ld
3737
endif()
3838

3939
if(CONFIG_GEN_SW_ISR_TABLE)
40-
if(CONFIG_DYNAMIC_INTERRUPTS)
40+
if(CONFIG_SRAM_SW_ISR_TABLE)
4141
zephyr_linker_sources(RWDATA swi_tables.ld)
4242
else()
4343
zephyr_linker_sources(RODATA swi_tables.ld)

arch/arm64/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ endif()
6060
add_subdirectory_ifdef(CONFIG_XEN xen)
6161

6262
if(CONFIG_GEN_SW_ISR_TABLE)
63-
if(CONFIG_DYNAMIC_INTERRUPTS)
63+
if(CONFIG_SRAM_SW_ISR_TABLE)
6464
zephyr_linker_sources(RWDATA swi_tables.ld)
6565
else()
6666
zephyr_linker_sources(RODATA swi_tables.ld)

cmake/linker_script/common/common-ram.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# The contents of this file is based on include/zephyr/linker/common-ram.ld
33
# Please keep in sync
44

5-
if(CONFIG_GEN_SW_ISR_TABLE AND CONFIG_DYNAMIC_INTERRUPTS)
5+
if(CONFIG_GEN_SW_ISR_TABLE AND CONFIG_SRAM_SW_ISR_TABLE)
66
# ld align has been changed to subalign to provide identical behavior scatter vs. ld.
77
zephyr_linker_section(NAME sw_isr_table
88
GROUP DATA_REGION

cmake/linker_script/common/common-rom.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ zephyr_linker_section_obj_level(SECTION init LEVEL SMP)
1313

1414
zephyr_iterable_section(NAME device NUMERIC KVMA RAM_REGION GROUP RODATA_REGION)
1515

16-
if(CONFIG_GEN_SW_ISR_TABLE AND NOT CONFIG_DYNAMIC_INTERRUPTS)
16+
if(CONFIG_GEN_SW_ISR_TABLE AND NOT CONFIG_SRAM_SW_ISR_TABLE)
1717
# ld align has been changed to subalign to provide identical behavior scatter vs. ld.
1818
zephyr_linker_section(NAME sw_isr_table KVMA FLASH GROUP RODATA_REGION SUBALIGN ${CONFIG_ARCH_SW_ISR_TABLE_ALIGN} NOINPUT)
1919
zephyr_linker_section_configure(

doc/releases/migration-guide-4.2.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,3 +760,6 @@ Architectures
760760
of vector table in RAM.
761761
* Renamed :kconfig:option:`CONFIG_DEBUG_INFO` to :kconfig:option:`CONFIG_X86_DEBUG_INFO` to
762762
better reflect its purpose. This option is now only available for x86 architecture.
763+
764+
* The :kconfig:option:`CONFIG_DYNAMIC_INTERRUPTS` option has a new dependency with
765+
:kconfig:option:`CONFIG_SRAM_SW_ISR_TABLE`.

doc/releases/release-notes-4.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ New APIs and options
127127
* :kconfig:option:`ARCH_HAS_VECTOR_TABLE_RELOCATION`
128128
* :kconfig:option:`CONFIG_SRAM_VECTOR_TABLE` moved from ``zephyr/Kconfig.zephyr`` to
129129
``zephyr/arch/Kconfig`` and added dependencies to it.
130+
* :kconfig:option:`CONFIG_SRAM_SW_ISR_TABLE`
130131

131132
* Kernel
132133

include/zephyr/linker/common-ram.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ITERABLE_SECTION_RAM(scmi_protocol, Z_LINK_ITERABLE_SUBALIGN)
1818
#endif /* CONFIG_ARM_SCMI */
1919

20-
#if defined(CONFIG_GEN_SW_ISR_TABLE) && defined(CONFIG_DYNAMIC_INTERRUPTS)
20+
#if defined(CONFIG_GEN_SW_ISR_TABLE) && defined(CONFIG_SRAM_SW_ISR_TABLE)
2121
SECTION_DATA_PROLOGUE(sw_isr_table,,)
2222
{
2323
/*

include/zephyr/linker/common-rom/common-rom-kernel-devices.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
4343
#endif
4444

45-
#if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_DYNAMIC_INTERRUPTS)
45+
#if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_SRAM_SW_ISR_TABLE)
4646
SECTION_PROLOGUE(sw_isr_table,,)
4747
{
4848
/*

0 commit comments

Comments
 (0)