6#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_XTENSA_IRQ_H_
7#define ZEPHYR_INCLUDE_ARCH_XTENSA_XTENSA_IRQ_H_
10#include <xtensa/config/core-isa.h>
12#define CONFIG_GEN_IRQ_START_VECTOR 0
19static inline void z_xt_ints_on(
unsigned int mask)
23 __asm__
volatile(
"rsr.intenable %0" :
"=r"(val));
25 __asm__
volatile(
"wsr.intenable %0; rsync" : :
"r"(val));
34static inline void z_xt_ints_off(
unsigned int mask)
38 __asm__
volatile(
"rsr.intenable %0" :
"=r"(val));
40 __asm__
volatile(
"wsr.intenable %0; rsync" : :
"r"(val));
46static inline void z_xt_set_intset(
unsigned int arg)
48#if XCHAL_HAVE_INTERRUPTS
49 __asm__
volatile(
"wsr.intset %0; rsync" : :
"r"(arg));
55#ifdef CONFIG_MULTI_LEVEL_INTERRUPTS
60#ifdef CONFIG_2ND_LEVEL_INTERRUPTS
61#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
62#define CONFIG_NUM_IRQS (XCHAL_NUM_INTERRUPTS +\
63 (CONFIG_NUM_2ND_LEVEL_AGGREGATORS +\
64 CONFIG_NUM_3RD_LEVEL_AGGREGATORS) *\
65 CONFIG_MAX_IRQ_PER_AGGREGATOR)
67#define CONFIG_NUM_IRQS (XCHAL_NUM_INTERRUPTS +\
68 CONFIG_NUM_2ND_LEVEL_AGGREGATORS *\
69 CONFIG_MAX_IRQ_PER_AGGREGATOR)
72#define CONFIG_NUM_IRQS XCHAL_NUM_INTERRUPTS
75#define arch_irq_enable(irq) z_soc_irq_enable(irq)
76#define arch_irq_disable(irq) z_soc_irq_disable(irq)
78#define arch_irq_is_enabled(irq) z_soc_irq_is_enabled(irq)
80#ifdef CONFIG_DYNAMIC_INTERRUPTS
81extern int z_soc_irq_connect_dynamic(
unsigned int irq,
unsigned int priority,
82 void (*routine)(
const void *parameter),
88#define CONFIG_NUM_IRQS XCHAL_NUM_INTERRUPTS
90#define arch_irq_enable(irq) z_xtensa_irq_enable(irq)
91#define arch_irq_disable(irq) z_xtensa_irq_disable(irq)
93#define arch_irq_is_enabled(irq) z_xtensa_irq_is_enabled(irq)
99 z_xt_ints_on(1 << irq);
104 z_xt_ints_off(1 << irq);
111 __asm__
volatile(
"rsil %0, %1"
112 :
"=r"(
key) :
"i"(XCHAL_EXCM_LEVEL) :
"memory");
118 __asm__
volatile(
"wsr.ps %0; rsync"
119 ::
"r"(
key) :
"memory");
124 return (
key & 0xf) == 0;
127extern int z_xtensa_irq_is_enabled(
unsigned int irq);
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
Definition: irq.h:107
static ALWAYS_INLINE void arch_irq_unlock(unsigned int key)
Definition: irq.h:116
static ALWAYS_INLINE bool arch_irq_unlocked(unsigned int key)
Definition: irq.h:122
#define ALWAYS_INLINE
Definition: common.h:116
flags
Definition: http_parser.h:131
Public interface for configuring interrupts.
static k_spinlock_key_t key
Definition: spinlock_error_case.c:14
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60