File tree Expand file tree Collapse file tree 7 files changed +29
-4
lines changed
cmake/linker_script/common Expand file tree Collapse file tree 7 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,7 @@ config ISR_TABLES_LOCAL_DECLARATION
472472
473473config DYNAMIC_INTERRUPTS
474474 bool "Installation of IRQs at runtime"
475+ select SRAM_SW_ISR_TABLE
475476 help
476477 Enable installation of interrupts at runtime, which will move some
477478 interrupt-related data structures to RAM instead of ROM, and
@@ -598,6 +599,12 @@ config SRAM_VECTOR_TABLE
598599 When XiP is enabled, this option will result in the vector table being
599600 relocated from Flash to SRAM.
600601
602+ config SRAM_SW_ISR_TABLE
603+ bool "Place the software ISR table in SRAM instead of flash"
604+ help
605+ The option specifies that the software interrupts vector table will be
606+ placed inside SRAM instead of the flash.
607+
601608config IRQ_OFFLOAD_NESTED
602609 bool "irq_offload() supports nested IRQs"
603610 depends on IRQ_OFFLOAD
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ zephyr_linker_section_obj_level(SECTION init LEVEL SMP)
1313
1414zephyr_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(
Original file line number Diff line number Diff line change @@ -197,6 +197,10 @@ generate exceptions that need to be handled synchronously (e.g. kernel panic).
197197 The feature is currently implemented in the ARM Cortex-M architecture
198198 variant.
199199
200+ .. tip ::
201+ To mitigate flash access latency, consider relocating ISRs and all related
202+ symbols to RAM. This eliminates flash access delays.
203+
200204Offloading ISR Work
201205===================
202206
@@ -374,6 +378,16 @@ Cortex-M architecture variant via the macro
374378:c:macro: `ARM_IRQ_DIRECT_DYNAMIC_CONNECT `, which can be used to declare a direct
375379and dynamic interrupt.
376380
381+ RAM-based ISR Execution
382+ =======================
383+
384+ For ultra-low latency, ISRs and vector tables can be relocated to RAM to eliminate
385+ flash access delays. :kconfig:option: `CONFIG_SRAM_VECTOR_TABLE ` and
386+ :kconfig:option: `CONFIG_SRAM_SW_ISR_TABLE ` will help you have interrupt vectors
387+ in RAM. :kconfig:option: `CONFIG_DEVICE_MUTABLE ` will help you put the device
388+ structure in RAM and :kconfig:option: `CONFIG_CODE_DATA_RELOCATION ` will help you relocate
389+ the ISR and all the related symbols to RAM.
390+
377391Sharing an interrupt line
378392=========================
379393
Original file line number Diff line number Diff line change @@ -75,6 +75,10 @@ New APIs and options
7575
7676.. zephyr-keep-sorted-start re(^\* \w)
7777
78+ * Architectures
79+
80+ * :kconfig:option: `CONFIG_SRAM_SW_ISR_TABLE `
81+
7882* Power management
7983
8084 * :c:func: `pm_device_driver_deinit `
Original file line number Diff line number Diff line change 1717ITERABLE_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 /*
Original file line number Diff line number Diff line change 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 /*
You can’t perform that action at this time.
0 commit comments