diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 4c0f06fbe9c..6ae200ac52a 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -90,4 +90,12 @@ config XTENSA_WAITI_BUG platforms which prefixes a WAITI entry with 128 NOP instructions followed by an ISYNC and EXTW. +config XTENSA_SMALL_VECTOR_TABLE_ENTRY + bool "Enable workaround for small vector table entries" + help + This option enables a small indirection to bypass the size + constraint of the vector table entry and moved the default + handlers to the end of vector table, renaming them to + _Level\LVL\()VectorHelper. + endmenu diff --git a/arch/xtensa/include/xtensa-asm2-s.h b/arch/xtensa/include/xtensa-asm2-s.h index 1e8626c76de..a10c4446bac 100644 --- a/arch/xtensa/include/xtensa-asm2-s.h +++ b/arch/xtensa/include/xtensa-asm2-s.h @@ -356,7 +356,7 @@ _restore_\@: * with a simple jump instruction. */ .macro DEF_EXCINT LVL, ENTRY_SYM, C_HANDLER_SYM -#if defined(CONFIG_IMX) && (MEM_VECT_TEXT_SIZE <= 0x1C) +#if defined(CONFIG_XTENSA_SMALL_VECTOR_TABLE_ENTRY) .pushsection .iram.text, "ax" .global _Level\LVL\()VectorHelper _Level\LVL\()VectorHelper : @@ -425,7 +425,7 @@ _after_imms\LVL: jx a0 .popsection -#if defined(CONFIG_IMX) && (MEM_VECT_TEXT_SIZE <= 0x1C) +#if defined(CONFIG_XTENSA_SMALL_VECTOR_TABLE_ENTRY) .if \LVL == 1 .pushsection .iram0.text, "ax" .elseif \LVL == XCHAL_DEBUGLEVEL