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
21static inline void z_xt_ints_on(
unsigned int mask)
25 __asm__
volatile(
"rsr.intenable %0" :
"=r"(val));
27 __asm__
volatile(
"wsr.intenable %0; rsync" : :
"r"(val));
36static inline void z_xt_ints_off(
unsigned int mask)
40 __asm__
volatile(
"rsr.intenable %0" :
"=r"(val));
42 __asm__
volatile(
"wsr.intenable %0; rsync" : :
"r"(val));
48static inline void z_xt_set_intset(
unsigned int arg)
50#if XCHAL_HAVE_INTERRUPTS
51 __asm__
volatile(
"wsr.intset %0; rsync" : :
"r"(arg));
57#ifdef CONFIG_MULTI_LEVEL_INTERRUPTS
62#ifdef CONFIG_2ND_LEVEL_INTERRUPTS
63#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
64#define CONFIG_NUM_IRQS (XCHAL_NUM_INTERRUPTS +\
65 (CONFIG_NUM_2ND_LEVEL_AGGREGATORS +\
66 CONFIG_NUM_3RD_LEVEL_AGGREGATORS) *\
67 CONFIG_MAX_IRQ_PER_AGGREGATOR)
69#define CONFIG_NUM_IRQS (XCHAL_NUM_INTERRUPTS +\
70 CONFIG_NUM_2ND_LEVEL_AGGREGATORS *\
71 CONFIG_MAX_IRQ_PER_AGGREGATOR)
74#define CONFIG_NUM_IRQS XCHAL_NUM_INTERRUPTS
77void z_soc_irq_init(
void);
78void z_soc_irq_enable(
unsigned int irq);
79void z_soc_irq_disable(
unsigned int irq);
80int z_soc_irq_is_enabled(
unsigned int irq);
82#define arch_irq_enable(irq) z_soc_irq_enable(irq)
83#define arch_irq_disable(irq) z_soc_irq_disable(irq)
85#define arch_irq_is_enabled(irq) z_soc_irq_is_enabled(irq)
87#ifdef CONFIG_DYNAMIC_INTERRUPTS
88extern int z_soc_irq_connect_dynamic(
unsigned int irq,
unsigned int priority,
89 void (*routine)(
const void *parameter),
95#define CONFIG_NUM_IRQS XCHAL_NUM_INTERRUPTS
97#define arch_irq_enable(irq) z_xtensa_irq_enable(irq)
98#define arch_irq_disable(irq) z_xtensa_irq_disable(irq)
100#define arch_irq_is_enabled(irq) z_xtensa_irq_is_enabled(irq)
106 z_xt_ints_on(1 << irq);
111 z_xt_ints_off(1 << irq);
118 __asm__
volatile(
"rsil %0, %1"
119 :
"=r"(key) :
"i"(XCHAL_EXCM_LEVEL) :
"memory");
125 __asm__
volatile(
"wsr.ps %0; rsync"
126 ::
"r"(key) :
"memory");
131 return (key & 0xf) == 0;
134extern int z_xtensa_irq_is_enabled(
unsigned int irq);
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
#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