arch/xtensa: Group all the macros in one file.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
parent
541eabb535
commit
98d8d2a1ff
@ -64,10 +64,16 @@
|
||||
#include <arch/xtensa/xtensa_abi.h>
|
||||
#include <arch/xtensa/xtensa_specregs.h>
|
||||
|
||||
#include "xtensa_macros.S"
|
||||
|
||||
#include "chip.h"
|
||||
#include "xtensa.h"
|
||||
#include "xtensa_timer.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Symbols
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
|
||||
.data
|
||||
.align 16
|
||||
@ -104,67 +110,6 @@ g_intstacktop:
|
||||
addi \aout, \aout, 1 /* Return aout + 1 */
|
||||
.endm
|
||||
|
||||
/****************************************************************************
|
||||
* Name: setintstack
|
||||
*
|
||||
* Description:
|
||||
* Set the current stack pointer to the "top" the interrupt stack.
|
||||
* Single CPU case.
|
||||
* Must be provided by MCU-specific logic in the SMP case.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
|
||||
.macro setintstack tmp1 tmp2
|
||||
movi a1, g_intstacktop
|
||||
.endm
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Macro: ps_setup
|
||||
*
|
||||
* Description:
|
||||
* Set up PS for C, enable interrupts above this level and clear EXCM.
|
||||
*
|
||||
* Entry Conditions:
|
||||
* level - interrupt level
|
||||
* tmp - scratch register
|
||||
*
|
||||
* Side Effects:
|
||||
* PS and scratch register modified
|
||||
*
|
||||
* Assumptions:
|
||||
* - PS.EXCM = 1, C calling disabled
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
.macro ps_setup level tmp
|
||||
|
||||
#if 0 /* Nested interrupts no yet supported */
|
||||
# ifdef __XTENSA_CALL0_ABI__
|
||||
/* Disable interrupts at level and below */
|
||||
|
||||
movi \tmp, PS_INTLEVEL(\level) | PS_UM
|
||||
# else
|
||||
movi \tmp, PS_INTLEVEL(\level) | PS_UM | PS_WOE
|
||||
# endif
|
||||
#else
|
||||
# ifdef __XTENSA_CALL0_ABI__
|
||||
/* Disable all low- and medium-priority interrupts. Nested are not yet
|
||||
* supported.
|
||||
*/
|
||||
|
||||
movi \tmp, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM
|
||||
# else
|
||||
movi \tmp, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
wsr \tmp, PS
|
||||
rsync
|
||||
|
||||
.endm
|
||||
|
||||
/****************************************************************************
|
||||
* Macro dispatch_c_isr level mask tmp
|
||||
*
|
||||
|
94
arch/xtensa/src/common/xtensa_macros.S
Normal file
94
arch/xtensa/src/common/xtensa_macros.S
Normal file
@ -0,0 +1,94 @@
|
||||
/****************************************************************************
|
||||
* arch/xtensa/src/common/xtensa_macros.S
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
.file "xtensa_macros.S"
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <arch/chip/core-isa.h>
|
||||
#include <arch/xtensa/xtensa_abi.h>
|
||||
#include <arch/xtensa/xtensa_specregs.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Name: setintstack
|
||||
*
|
||||
* Description:
|
||||
* Set the current stack pointer to the "top" the interrupt stack.
|
||||
* Single CPU case.
|
||||
* Must be provided by MCU-specific logic in the SMP case.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
|
||||
.macro setintstack tmp1 tmp2
|
||||
movi a1, g_intstacktop
|
||||
.endm
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Macro: ps_setup
|
||||
*
|
||||
* Description:
|
||||
* Set up PS for C, enable interrupts above this level and clear EXCM.
|
||||
*
|
||||
* Entry Conditions:
|
||||
* level - interrupt level
|
||||
* tmp - scratch register
|
||||
*
|
||||
* Side Effects:
|
||||
* PS and scratch register modified
|
||||
*
|
||||
* Assumptions:
|
||||
* - PS.EXCM = 1, C calling disabled
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
.macro ps_setup level tmp
|
||||
|
||||
#if 0 /* Nested interrupts no yet supported */
|
||||
# ifdef __XTENSA_CALL0_ABI__
|
||||
/* Disable interrupts at level and below */
|
||||
|
||||
movi \tmp, PS_INTLEVEL(\level) | PS_UM
|
||||
# else
|
||||
movi \tmp, PS_INTLEVEL(\level) | PS_UM | PS_WOE
|
||||
# endif
|
||||
#else
|
||||
# ifdef __XTENSA_CALL0_ABI__
|
||||
/* Disable all low- and medium-priority interrupts. Nested are not yet
|
||||
* supported.
|
||||
*/
|
||||
|
||||
movi \tmp, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM
|
||||
# else
|
||||
movi \tmp, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
wsr \tmp, PS
|
||||
rsync
|
||||
|
||||
.endm
|
||||
|
@ -64,28 +64,10 @@
|
||||
#include <arch/xtensa/core.h>
|
||||
#include <arch/xtensa/xtensa_specregs.h>
|
||||
|
||||
#include "xtensa_macros.S"
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Assembly Language Macros
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: setintstack
|
||||
*
|
||||
* Description:
|
||||
* Set the current stack pointer to the "top" the interrupt stack.
|
||||
* Single CPU case.
|
||||
* Must be provided by MCU-specific logic in the SMP case.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
|
||||
.macro setintstack tmp1 tmp2
|
||||
movi a1, g_intstacktop
|
||||
.endm
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -147,14 +129,7 @@ _xtensa_panic:
|
||||
|
||||
/* Set up PS for C, re-enable hi-pri interrupts, and clear EXCM. */
|
||||
|
||||
#ifdef __XTENSA_CALL0_ABI__
|
||||
movi a0, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM
|
||||
#else
|
||||
movi a0, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE
|
||||
#endif
|
||||
|
||||
wsr a0, PS
|
||||
rsync
|
||||
ps_setup XCHAL_EXCM_LEVEL a0
|
||||
|
||||
/* Call C panic handler: Arg1 (A2) = Exception code; Arg 2 (A3) = start
|
||||
* of the register save area.
|
||||
|
@ -64,73 +64,10 @@
|
||||
#include <arch/xtensa/core.h>
|
||||
#include <arch/xtensa/xtensa_specregs.h>
|
||||
|
||||
#include "xtensa_macros.S"
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Assembly Language Macros
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: setintstack
|
||||
*
|
||||
* Description:
|
||||
* Set the current stack pointer to the "top" the interrupt stack.
|
||||
* Single CPU case.
|
||||
* Must be provided by MCU-specific logic in the SMP case.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 15
|
||||
.macro setintstack tmp1 tmp2
|
||||
movi a1, g_intstacktop
|
||||
.endm
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Macro: ps_setup
|
||||
*
|
||||
* Description:
|
||||
* Set up PS for C, enable interrupts above this level and clear EXCM.
|
||||
*
|
||||
* Entry Conditions:
|
||||
* level - interrupt level
|
||||
* tmp - scratch register
|
||||
*
|
||||
* Side Effects:
|
||||
* PS and scratch register modified
|
||||
*
|
||||
* Assumptions:
|
||||
* - PS.EXCM = 1, C calling disabled
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
.macro ps_setup level tmp
|
||||
|
||||
#if 0 /* Nested interrupts no yet supported */
|
||||
# ifdef __XTENSA_CALL0_ABI__
|
||||
/* Disable interrupts at level and below */
|
||||
|
||||
movi \tmp, PS_INTLEVEL(\level) | PS_UM
|
||||
# else
|
||||
movi \tmp, PS_INTLEVEL(\level) | PS_UM | PS_WOE
|
||||
# endif
|
||||
#else
|
||||
# ifdef __XTENSA_CALL0_ABI__
|
||||
/* Disable all low- and medium-priority interrupts. Nested are not yet
|
||||
* supported.
|
||||
*/
|
||||
|
||||
movi \tmp, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM
|
||||
# else
|
||||
movi \tmp, PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
wsr \tmp, PS
|
||||
rsync
|
||||
|
||||
.endm
|
||||
|
||||
/****************************************************************************
|
||||
* Waypoints
|
||||
****************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user