From 2c83d79465f50127e531543b714d4e58eeee94b8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 23 Oct 2016 06:24:35 -0600 Subject: [PATCH] Xtensa: Remove 'virtual' interrupt support --- arch/xtensa/include/irq.h | 4 +- arch/xtensa/src/common/xtensa_inthandlers.S | 2 +- arch/xtensa/src/common/xtensa_irq.S | 150 -------------------- arch/xtensa/src/esp32/Make.defs | 2 +- arch/xtensa/src/esp32/chip/esp32_soc.h | 4 +- 5 files changed, 6 insertions(+), 156 deletions(-) delete mode 100644 arch/xtensa/src/common/xtensa_irq.S diff --git a/arch/xtensa/include/irq.h b/arch/xtensa/include/irq.h index ae7e71ec37..7bfd3ebdcb 100644 --- a/arch/xtensa/include/irq.h +++ b/arch/xtensa/include/irq.h @@ -129,8 +129,8 @@ #ifdef CONFIG_XTENSA_USE_OVLY /* Storage for overlay state */ -# define REG_OVLY (_REG_OVLY_START + 0) -# define XCPTCONTEXT_REGS (_REG_OVLY_START + 1) +# error Overlays not supported +# define XCPTCONTEXT_REGS _REG_OVLY_START #else # define XCPTCONTEXT_REGS _REG_OVLY_START #endif diff --git a/arch/xtensa/src/common/xtensa_inthandlers.S b/arch/xtensa/src/common/xtensa_inthandlers.S index 32562b5834..1b16559d30 100644 --- a/arch/xtensa/src/common/xtensa_inthandlers.S +++ b/arch/xtensa/src/common/xtensa_inthandlers.S @@ -294,7 +294,7 @@ _xtensa_level2_handler: rsr a0, EXCSAVE_2 /* Save interruptee's a0 */ s32i a0, sp, (4 * REG_A0) - /* Save rest of interrupt context and enter RTOS. */ + /* Save rest of interrupt context. */ s32i a2, sp, (4 * REG_A2) movi a2, sp /* Address of state save on stack */ diff --git a/arch/xtensa/src/common/xtensa_irq.S b/arch/xtensa/src/common/xtensa_irq.S deleted file mode 100644 index 9244a42052..0000000000 --- a/arch/xtensa/src/common/xtensa_irq.S +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** - * arch/xtensa/src/common/xtensa_irq.S - * - * Adapted from use in NuttX by: - * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derives from logic originally provided by Cadence Design Systems Inc. - * - * Copyright (c) 2006-2015 Cadence Design Systems Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ****************************************************************************/ - - .file "xtensa_irq.S" - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include "xtensa_specregs.h" -#include "xtensa_macros.h" - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef CONFIG_XCHAL_HAVE_INTERRUPTS - -/* INTENABLE virtualization information. */ - - .data - .global _xtensa_intdata - .align 8 -_xtensa_intdata: - - .global _xtensa_intenable - .type _xtensa_intenable, @object -_xtensa_intenable: - .word 0 /* Virtual INTENABLE */ - .size _xtensa_intenable,4 - - .global _xtensa_vprimask - .type _xtensa_vprimask, @object -_xtensa_vprimask: - .word 0xffffffff /* Virtual priority mask */ - .size _xtensa_vprimask, 4 - -#endif /* CONFIG_XCHAL_HAVE_INTERRUPTS */ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * C Prototype: - * irqstate_t xtensa_enable_interrupts(irqstate_t mask) - * - * Description: - * Enables a set of interrupts. Does not simply set INTENABLE directly, - * but computes it as a function of the current virtual priority. - * Can be called from interrupt handlers. - * - ****************************************************************************/ - - .text - .align 4 - .global xtensa_enable_interrupts - .type xtensa_enable_interrupts, @function - -xtensa_enable_interrupts: - - ENTRY0 -#ifdef CONFIG_XCHAL_HAVE_INTERRUPTS - movi a3, 0 - movi a4, _xtensa_intdata - xsr a3, INTENABLE /* Disables all interrupts */ - rsync - l32i a3, a4, 0 /* a3 = _xtensa_intenable */ - l32i a6, a4, 4 /* a6 = _xtensa_vprimask */ - or a5, a3, a2 /* a5 = _xtensa_intenable | mask */ - s32i a5, a4, 0 /* _xtensa_intenable |= mask */ - and a5, a5, a6 /* a5 = _xtensa_intenable & _xtensa_vprimask */ - wsr a5, INTENABLE /* Reenable interrupts */ - mov a2, a3 /* Previous mask */ -#else - movi a2, 0 /* Return zero */ -#endif - RET0 - - .size xtensa_enable_interrupts, . - xtensa_enable_interrupts - -/**************************************************************************** - * C Prototype: - * irqstate_t xtensa_disable_interrupts(irqstate_t mask) - * - * Description: - * Disables a set of interrupts. Does not simply set INTENABLE directly, - * but computes it as a function of the current virtual priority. - * Can be called from interrupt handlers. - * - ****************************************************************************/ - - .text - .align 4 - .global xtensa_disable_interrupts - .type xtensa_disable_interrupts,@function - -xtensa_disable_interrupts: - - ENTRY0 -#ifdef CONFIG_XCHAL_HAVE_INTERRUPTS - movi a3, 0 - movi a4, _xtensa_intdata - xsr a3, INTENABLE /* Disables all interrupts */ - rsync - l32i a3, a4, 0 /* a3 = _xtensa_intenable */ - l32i a6, a4, 4 /* a6 = _xtensa_vprimask */ - or a5, a3, a2 /* a5 = _xtensa_intenable | mask */ - xor a5, a5, a2 /* a5 = _xtensa_intenable & ~mask */ - s32i a5, a4, 0 /* _xtensa_intenable &= ~mask */ - and a5, a5, a6 /* a5 = _xtensa_intenable & _xtensa_vprimask */ - wsr a5, INTENABLE /* Reenable interrupts */ - mov a2, a3 /* Previous mask */ -#else - movi a2, 0 /* return zero */ -#endif - RET0 - - .size xtensa_disable_interrupts, . - xtensa_disable_interrupts diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs index 5ec3886f99..fea64934e1 100644 --- a/arch/xtensa/src/esp32/Make.defs +++ b/arch/xtensa/src/esp32/Make.defs @@ -40,7 +40,7 @@ HEAD_CSRC = esp32_start.c # Common XTENSA files (arch/xtensa/src/common) -CMN_ASRCS = xtensa_context.S xtensa_irq.S xtensa_intvectors.S +CMN_ASRCS = xtensa_context.S xtensa_intvectors.S CMN_CSRCS = xtensa_assert.c xtensa_blocktask.c xtensa_copystate.c CMN_CSRCS += xtensa_createstack.c xtensa_exit.c xtensa_idle.c CMN_CSRCS += xtensa_initialize.c xtensa_initialstate.c diff --git a/arch/xtensa/src/esp32/chip/esp32_soc.h b/arch/xtensa/src/esp32/chip/esp32_soc.h index 6760b1509e..20405c067d 100644 --- a/arch/xtensa/src/esp32/chip/esp32_soc.h +++ b/arch/xtensa/src/esp32/chip/esp32_soc.h @@ -308,7 +308,7 @@ * 3 1 extern level TG0_WDT Reserved * 4 1 extern level WBB * 5 1 extern level BT Controller - * 6 1 timer FreeRTOS Tick(L1) FreeRTOS Tick(L1) + * 6 1 timer RTOS Tick RTOS Tick * 7 1 software Reserved Reserved * 8 1 extern level BLE Controller * 9 1 extern level @@ -317,7 +317,7 @@ * 12 1 extern level * 13 1 extern level * 14 7 nmi Reserved Reserved - * 15 3 timer FreeRTOS Tick(L3) FreeRTOS Tick(L3) + * 15 3 timer Internal Timer * 16 5 timer * 17 1 extern level * 18 1 extern level