Skip to content

Commit bf6988a

Browse files
arch: split dynamic interrupt symbol
This commit introduce SRAM_ISR_VECTOR_TABLE hidden option which is selected by DYNAMIC_INTERRUPT. It allows to split the DYNAMIC_INTERRUPT option in two parts: - One for the relocation of the ISR vector table in ram - One for the inclusion of function needed to install ISR dynamically The goal behind is to later only select to relocation of the ISR vector table in RAM and not all the assiocated functions from dynamic interrupt mechanism. Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
1 parent 5d74f78 commit bf6988a

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
@@ -462,6 +462,7 @@ config ISR_TABLES_LOCAL_DECLARATION
462462

463463
config DYNAMIC_INTERRUPTS
464464
bool "Installation of IRQs at runtime"
465+
select SRAM_SW_ISR_TABLE
465466
help
466467
Enable installation of interrupts at runtime, which will move some
467468
interrupt-related data structures to RAM instead of ROM, and
@@ -582,6 +583,12 @@ config SRAM_VECTOR_TABLE
582583
When XiP is enabled, this option will result in the vector table being
583584
relocated from Flash to SRAM.
584585

586+
config SRAM_SW_ISR_TABLE
587+
bool
588+
help
589+
The option specifies that the software interrupts vector table will be
590+
placed inside SRAM instead of the flash.
591+
585592
config IRQ_OFFLOAD_NESTED
586593
bool "irq_offload() supports nested IRQs"
587594
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 SUBALIGN ${CONFIG_LINKER_ITERABLE_SUBALIGN})
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
@@ -335,3 +335,6 @@ Architectures
335335
:kconfig:option:`CONFIG_ARCH_HAS_VECTOR_TABLE_RELOCATION` and
336336
:kconfig:option:`CONFIG_ROMSTART_RELOCATION_ROM` to support relocation
337337
of vector table in RAM.
338+
339+
* The :kconfig:option:`CONFIG_DYNAMIC_INTERRUPTS` option has a new dependency with
340+
: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
@@ -111,6 +111,7 @@ New APIs and options
111111
* :kconfig:option:`ARCH_HAS_VECTOR_TABLE_RELOCATION`
112112
* :kconfig:option:`CONFIG_SRAM_VECTOR_TABLE` moved from ``zephyr/Kconfig.zephyr`` to
113113
``zephyr/arch/Kconfig`` and added dependencies to it.
114+
* :kconfig:option:`CONFIG_SRAM_SW_ISR_TABLE`
114115

115116
* Kernel
116117

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)