6#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_XTENSA_IRQ_H_
7#define ZEPHYR_INCLUDE_ARCH_XTENSA_XTENSA_IRQ_H_
12#include <xtensa/config/core-isa.h>
14#define CONFIG_GEN_IRQ_START_VECTOR 0
25static inline void z_xt_ints_on(
unsigned int mask)
29 __asm__
volatile(
"rsr.intenable %0" :
"=r"(val));
31 __asm__
volatile(
"wsr.intenable %0; rsync" : :
"r"(val));
40static inline void z_xt_ints_off(
unsigned int mask)
44 __asm__
volatile(
"rsr.intenable %0" :
"=r"(val));
46 __asm__
volatile(
"wsr.intenable %0; rsync" : :
"r"(val));
53static inline void z_xt_set_intset(
unsigned int arg)
55#if XCHAL_HAVE_INTERRUPTS
56 __asm__
volatile(
"wsr.intset %0; rsync" : :
"r"(arg));
66#ifdef CONFIG_MULTI_LEVEL_INTERRUPTS
71#ifdef CONFIG_2ND_LEVEL_INTERRUPTS
72#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
73#define CONFIG_NUM_IRQS (XCHAL_NUM_INTERRUPTS +\
74 (CONFIG_NUM_2ND_LEVEL_AGGREGATORS +\
75 CONFIG_NUM_3RD_LEVEL_AGGREGATORS) *\
76 CONFIG_MAX_IRQ_PER_AGGREGATOR)
78#define CONFIG_NUM_IRQS (XCHAL_NUM_INTERRUPTS +\
79 CONFIG_NUM_2ND_LEVEL_AGGREGATORS *\
80 CONFIG_MAX_IRQ_PER_AGGREGATOR)
83#define CONFIG_NUM_IRQS XCHAL_NUM_INTERRUPTS
86void z_soc_irq_init(
void);
87void z_soc_irq_enable(
unsigned int irq);
88void z_soc_irq_disable(
unsigned int irq);
89int z_soc_irq_is_enabled(
unsigned int irq);
91#define arch_irq_enable(irq) z_soc_irq_enable(irq)
92#define arch_irq_disable(irq) z_soc_irq_disable(irq)
94#define arch_irq_is_enabled(irq) z_soc_irq_is_enabled(irq)
96#ifdef CONFIG_DYNAMIC_INTERRUPTS
97extern int z_soc_irq_connect_dynamic(
unsigned int irq,
unsigned int priority,
98 void (*routine)(
const void *parameter),
104#define CONFIG_NUM_IRQS XCHAL_NUM_INTERRUPTS
106#define arch_irq_enable(irq) xtensa_irq_enable(irq)
107#define arch_irq_disable(irq) xtensa_irq_disable(irq)
109#define arch_irq_is_enabled(irq) xtensa_irq_is_enabled(irq)
120 z_xt_ints_on(1 << irq);
130 z_xt_ints_off(1 << irq);
138 __asm__
volatile(
"rsil %0, %1"
139 :
"=r"(key) :
"i"(XCHAL_EXCM_LEVEL) :
"memory");
146 __asm__
volatile(
"wsr.ps %0; rsync"
147 ::
"r"(key) :
"memory");
153 return (key & 0xf) == 0;
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
Disable all interrupts on the local CPU.
Definition: irq.h:168
static ALWAYS_INLINE void arch_irq_unlock(unsigned int key)
Definition: irq.h:176
static ALWAYS_INLINE bool arch_irq_unlocked(unsigned int key)
Definition: irq.h:181
static ALWAYS_INLINE void xtensa_irq_disable(uint32_t irq)
Disable interrupt on Xtensa core.
Definition: irq.h:128
static ALWAYS_INLINE void xtensa_irq_enable(uint32_t irq)
Enable interrupt on Xtensa core.
Definition: irq.h:118
int xtensa_irq_is_enabled(unsigned int irq)
Query if an interrupt is enabled on Xtensa core.
#define ALWAYS_INLINE
Definition: common.h:129
Public interface for configuring interrupts.
flags
Definition: parser.h:96
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90