Xtensa: Correct variou compilation issues

This commit is contained in:
Gregory Nutt 2016-10-23 08:04:57 -06:00
parent a9a4f6384d
commit 112b62a14e
5 changed files with 32 additions and 10 deletions

View File

@ -50,8 +50,8 @@
#include <nuttx/irq.h>
#include <arch/types.h>
#include <arch/chip/core-isa.h>
#include <arch/xtensa/specregs.h>
#include <arch/xtensa/corebits.h>
#include <arch/xtensa/xtensa_specregs.h>
#include <arch/xtensa/xtensa_corebits.h>
/* Include architecture-specific IRQ definitions */
@ -191,7 +191,7 @@ static inline void xtensa_setps(uint32_t ps)
{
__asm__ __volatile__
(
"wsr %0, PS" : : "=r"(ps)
"wsr %0, PS" : : "r"(ps)
);
}
@ -201,7 +201,7 @@ static inline void up_irq_restore(uint32_t ps)
{
__asm__ __volatile__
(
"wsr %0, PS" : : "=r"(ps)
"wsr %0, PS" : : "r"(ps)
);
}
@ -234,6 +234,28 @@ static inline uint32_t up_irq_save(void)
return ps;
}
/* Enable interrupts at all levels */
static inline void up_irq_enable(void)
{
#ifdef CONFIG_XTENSA_CALL0_ABI
xtensa_setps(PS_INTLEVEL(0) | PS_UM);
#else
xtensa_setps(PS_INTLEVEL(0) | PS_UM | PS_WOE);
#endif
}
/* Disable low- and medium- priority interrupts */
static inline void up_irq_disable(void)
{
#ifdef CONFIG_XTENSA_CALL0_ABI
xtensa_setps(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM);
#else
xtensa_setps(PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE);
#endif
}
/****************************************************************************
* Public Data
****************************************************************************/

View File

@ -61,7 +61,7 @@
#include <arch/irq.h>
#include <arch/chip/core-isa.h>
#include <arch/xtensa/xtensa_specreg.h>
#include <arch/xtensa/xtensa_specregs.h>
#include "xtensa_macros.h"
#include "xtensa_timer.h"

View File

@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <arch/chip/core-isa.h>
#include <arch/xtensa/xtensa_specreg.h>
#include <arch/xtensa/xtensa_specregs.h>
#include "xtensa_macros.h"

View File

@ -112,10 +112,10 @@ static int esp32_nmi(int irq, FAR void *context)
****************************************************************************/
/****************************************************************************
* Name: up_irqinitialize
* Name: xtensa_irq_initialize
****************************************************************************/
void up_irqinitialize(void)
void xtensa_irq_initialize(void)
{
int i;

View File

@ -79,7 +79,7 @@ static int esp32_timerisr(int irq, uint32_t *regs)
****************************************************************************/
/****************************************************************************
* Function: up_timer_initialize
* Function: xtensa_timer_initialize
*
* Description:
* This function is called during start-up to initialize
@ -87,7 +87,7 @@ static int esp32_timerisr(int irq, uint32_t *regs)
*
****************************************************************************/
void up_timer_initialize(void)
void xtensa_timer_initialize(void)
{
uint32_t regval;