diff --git a/arch/xtensa/core/xtensa_intr.c b/arch/xtensa/core/xtensa_intr.c index 38031c965dd..ca6861a3e4b 100644 --- a/arch/xtensa/core/xtensa_intr.c +++ b/arch/xtensa/core/xtensa_intr.c @@ -17,44 +17,15 @@ #include #if XCHAL_HAVE_EXCEPTIONS - -/* Handler table is in xtensa_intr_asm.S */ - -extern xt_exc_handler _xt_exception_table[XCHAL_EXCCAUSE_NUM]; - -/* - * Default handler for unhandled exceptions. - */ -void xt_unhandled_exception(XtExcFrame *frame) +static void unhandled_exception_trampoline(XtExcFrame *frame) { FatalErrorHandler(); CODE_UNREACHABLE; } - -/* - * This function registers a handler for the specified exception. - * The function returns the address of the previous handler. - * On error, it returns 0. - */ -xt_exc_handler _xt_set_exception_handler(int n, xt_exc_handler f) -{ - xt_exc_handler old; - - if (n < 0 || n >= XCHAL_EXCCAUSE_NUM) - return 0; /* invalid exception number */ - - old = _xt_exception_table[n]; - - if (f) { - _xt_exception_table[n] = f; - } else { - _xt_exception_table[n] = &xt_unhandled_exception; - } - - return ((old == &xt_unhandled_exception) ? 0 : old); -} - +xt_exc_handler _xt_exception_table[XCHAL_EXCCAUSE_NUM] __aligned(4) = { + [0 ... (XCHAL_EXCCAUSE_NUM - 1)] = unhandled_exception_trampoline +}; #endif #if defined(CONFIG_SW_ISR_TABLE) && defined(XCHAL_HAVE_INTERRUPTS) diff --git a/arch/xtensa/core/xtensa_intr_asm.S b/arch/xtensa/core/xtensa_intr_asm.S index 12bd1d457cc..091092c0faf 100644 --- a/arch/xtensa/core/xtensa_intr_asm.S +++ b/arch/xtensa/core/xtensa_intr_asm.S @@ -39,28 +39,6 @@ _xt_vpri_mask: .word 0xFFFFFFFF /* Virtual priority mask */ #endif /* XCHAL_HAVE_INTERRUPTS */ -#if XCHAL_HAVE_EXCEPTIONS - -/* -------------------------------------------------------------------------------- - Table of C-callable exception handlers for each exception. Note that not all - slots will be active, because some exceptions (e.g. coprocessor exceptions) - are always handled by the OS and cannot be hooked by user handlers. -------------------------------------------------------------------------------- -*/ - - .data - .global _xt_exception_table - .align 4 - -_xt_exception_table: - .rept XCHAL_EXCCAUSE_NUM - .word xt_unhandled_exception /* handler address */ - .endr - -#endif - - /* ------------------------------------------------------------------------------- unsigned int _xt_ints_on ( unsigned int mask ) diff --git a/arch/xtensa/soc/D_108mini/linker.ld b/arch/xtensa/soc/D_108mini/linker.ld index 94d62e591a3..39d65870594 100644 --- a/arch/xtensa/soc/D_108mini/linker.ld +++ b/arch/xtensa/soc/D_108mini/linker.ld @@ -50,7 +50,7 @@ MEMORY srom1_seg : org = 0x50000300, len = 0xFFFD00 sram0_seg : org = 0x60000000, len = 0x4000000 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3ffbe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/D_212GP/linker.ld b/arch/xtensa/soc/D_212GP/linker.ld index 375a51221df..4d983802b5c 100644 --- a/arch/xtensa/soc/D_212GP/linker.ld +++ b/arch/xtensa/soc/D_212GP/linker.ld @@ -50,7 +50,7 @@ MEMORY sram18_seg : org = 0x600003C0, len = 0x40 sram19_seg : org = 0x60000400, len = 0x3FFFC00 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3ffbe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/D_233L/linker.ld b/arch/xtensa/soc/D_233L/linker.ld index e84f8af2c46..7a94a19b15f 100644 --- a/arch/xtensa/soc/D_233L/linker.ld +++ b/arch/xtensa/soc/D_233L/linker.ld @@ -47,7 +47,7 @@ MEMORY srom0_seg : org = 0xFE000000, len = 0x300 srom1_seg : org = 0xFE000300, len = 0xFFFD00 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3ffdd50, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/XRC_D2PM_5swIrq/linker.ld b/arch/xtensa/soc/XRC_D2PM_5swIrq/linker.ld index 189a4dd0e06..1516a2b7ad6 100644 --- a/arch/xtensa/soc/XRC_D2PM_5swIrq/linker.ld +++ b/arch/xtensa/soc/XRC_D2PM_5swIrq/linker.ld @@ -50,7 +50,7 @@ MEMORY sram18_seg : org = 0x6000027C, len = 0x1C sram19_seg : org = 0x60000298, len = 0x3FFFD68 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3fffe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/linker.ld b/arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/linker.ld index 6ce6a140f1a..9072fe713c1 100644 --- a/arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/linker.ld +++ b/arch/xtensa/soc/XRC_FUSION_AON_ALL_LM/linker.ld @@ -35,7 +35,7 @@ MEMORY srom1_seg : org = 0x50000300, len = 0xFFFD00 sram0_seg : org = 0x60000000, len = 0x4000000 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3ffde000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/esp32/linker.ld b/arch/xtensa/soc/esp32/linker.ld index efd4adc43ee..c1921228f0d 100644 --- a/arch/xtensa/soc/esp32/linker.ld +++ b/arch/xtensa/soc/esp32/linker.ld @@ -38,7 +38,7 @@ MEMORY rtc_iram_seg(RWX): org = 0x400C0000, len = 0x2000 rtc_slow_seg(RW): org = 0x50000000, len = 0x1000 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST(RW): org = 0xffffdfff, len = 0x2000 + IDT_LIST(RW): org = 0x3ebfe010, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/hifi2_std/linker.ld b/arch/xtensa/soc/hifi2_std/linker.ld index 6ef738547ad..ee972bbdd58 100644 --- a/arch/xtensa/soc/hifi2_std/linker.ld +++ b/arch/xtensa/soc/hifi2_std/linker.ld @@ -50,7 +50,7 @@ MEMORY sram18_seg : org = 0x600003C0, len = 0x40 sram19_seg : org = 0x60000400, len = 0x3FFFC00 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3ffbe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/hifi3_bd5/linker.ld b/arch/xtensa/soc/hifi3_bd5/linker.ld index ee00d60bdc8..f11e4cd985d 100644 --- a/arch/xtensa/soc/hifi3_bd5/linker.ld +++ b/arch/xtensa/soc/hifi3_bd5/linker.ld @@ -37,7 +37,7 @@ MEMORY sram8_seg : org = 0x600001DC, len = 0x1C sram9_seg : org = 0x600001F8, len = 0x3FFFE08 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x4fffe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/hifi3_bd5_call0/linker.ld b/arch/xtensa/soc/hifi3_bd5_call0/linker.ld index ee00d60bdc8..f11e4cd985d 100644 --- a/arch/xtensa/soc/hifi3_bd5_call0/linker.ld +++ b/arch/xtensa/soc/hifi3_bd5_call0/linker.ld @@ -37,7 +37,7 @@ MEMORY sram8_seg : org = 0x600001DC, len = 0x1C sram9_seg : org = 0x600001F8, len = 0x3FFFE08 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x4fffe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/hifi4_bd7/linker.ld b/arch/xtensa/soc/hifi4_bd7/linker.ld index 392608155ff..68a6d26850f 100644 --- a/arch/xtensa/soc/hifi4_bd7/linker.ld +++ b/arch/xtensa/soc/hifi4_bd7/linker.ld @@ -41,7 +41,7 @@ MEMORY sram12_seg : org = 0x60000300, len = 0x40 sram13_seg : org = 0x60000340, len = 0x3FFCC0 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x4fffe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/hifi_mini/linker.ld b/arch/xtensa/soc/hifi_mini/linker.ld index 2f1841bb248..643dc401dbd 100644 --- a/arch/xtensa/soc/hifi_mini/linker.ld +++ b/arch/xtensa/soc/hifi_mini/linker.ld @@ -34,7 +34,7 @@ MEMORY iram0_6_seg : org = 0x60020324, len = 0x1C iram0_7_seg : org = 0x60020340, len = 0x1FCC0 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x5fffe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/hifi_mini_4swIrq/linker.ld b/arch/xtensa/soc/hifi_mini_4swIrq/linker.ld index 5afc9795f5a..3f9c626d05e 100644 --- a/arch/xtensa/soc/hifi_mini_4swIrq/linker.ld +++ b/arch/xtensa/soc/hifi_mini_4swIrq/linker.ld @@ -34,7 +34,7 @@ MEMORY iram0_6_seg : org = 0x60020324, len = 0x1C iram0_7_seg : org = 0x60020340, len = 0x1FCC0 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x5fffe000, len = 0x2000 #endif } diff --git a/arch/xtensa/soc/sample_controller/linker.ld b/arch/xtensa/soc/sample_controller/linker.ld index 94d62e591a3..39d65870594 100644 --- a/arch/xtensa/soc/sample_controller/linker.ld +++ b/arch/xtensa/soc/sample_controller/linker.ld @@ -50,7 +50,7 @@ MEMORY srom1_seg : org = 0x50000300, len = 0xFFFD00 sram0_seg : org = 0x60000000, len = 0x4000000 #ifdef CONFIG_GEN_ISR_TABLES - IDT_LIST : org = 0xffffdfff, len = 0x2000 + IDT_LIST : org = 0x3ffbe000, len = 0x2000 #endif }