From 520513f456dcb9b5e0918d02f678f0d95c6176ff Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 20 Oct 2016 14:34:51 -0600 Subject: [PATCH] Xtensa: Add interrupt decode framework --- arch/xtensa/src/common/xtensa_intdecode.c | 69 +++++++++++++++++++++++ arch/xtensa/src/esp32/Make.defs | 8 +-- 2 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 arch/xtensa/src/common/xtensa_intdecode.c diff --git a/arch/xtensa/src/common/xtensa_intdecode.c b/arch/xtensa/src/common/xtensa_intdecode.c new file mode 100644 index 00000000000..c170732f6ba --- /dev/null +++ b/arch/xtensa/src/common/xtensa_intdecode.c @@ -0,0 +1,69 @@ +/**************************************************************************** + * arch/xtensa/src/common/xtensa_intdecode.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "xtensa.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: xtensa_intdecode + * + * Description: + * Determine the peripheral that geneated the interrupt and dispatch + * handling to the registered interrupt handler via irq_dispatch(). + * + * Input Parameters: + * regs - Saves processor state on the stack + * + * Returned Value: + * Normally the same vale as regs is returned. But, in the event of an + * interrupt level context switch, the returned value will, instead point + * to the saved processor state in the TCB of the newly started task. + * + ****************************************************************************/ + +uint32_t xtensa_intdecode(uint32_t *regs) +{ +#warning Missing implementation + return regs; +} diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs index 1954962fdcb..c9570489206 100644 --- a/arch/xtensa/src/esp32/Make.defs +++ b/arch/xtensa/src/esp32/Make.defs @@ -44,10 +44,10 @@ CMN_ASRCS = xtensa_context.S xtensa_irq.S xtensa_intvectors.S CMN_CSRCS = xtensa_assert.c xtensa_copystate.c CMN_CSRCS += xtensa_createstack.c xtensa_exit.c xtensa_idle.c CMN_CSRCS += xtensa_initialize.c xtensa_initialstate.c -CMN_CSRCS += xtensa_interruptcontext.c xtensa_lowputs.c xtensa_mdelay.c -CMN_CSRCS += xtensa_modifyreg8.c xtensa_modifyreg16.c xtensa_modifyreg32.c -CMN_CSRCS += xtensa_puts.c xtensa_releasestack.c xtensa_stackframe.c -CMN_CSRCS += xtensa_udelay.c xtensa_usestack.c +CMN_CSRCS += xtensa_interruptcontext.c xtensa_intdecode.c xtensa_lowputs.c +CMN_CSRCS += xtensa_mdelay.c xtensa_modifyreg8.c xtensa_modifyreg16.c +CMN_CSRCS += xtensa_modifyreg32.c xtensa_puts.c xtensa_releasestack.c +CMN_CSRCS += xtensa_stackframe.c xtensa_udelay.c xtensa_usestack.c # Configuration-dependent common XTENSA files