16#ifndef ZEPHYR_INCLUDE_ARCH_ARM_IRQ_H_
17#define ZEPHYR_INCLUDE_ARCH_ARM_IRQ_H_
31#if defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER)
32GTEXT(z_soc_irq_get_active)
37#if !defined(CONFIG_ARM_CUSTOM_INTERRUPT_CONTROLLER)
44extern void z_arm_irq_priority_set(
unsigned int irq,
unsigned int prio,
54void z_soc_irq_init(
void);
55void z_soc_irq_enable(
unsigned int irq);
56void z_soc_irq_disable(
unsigned int irq);
57int z_soc_irq_is_enabled(
unsigned int irq);
59void z_soc_irq_priority_set(
60 unsigned int irq,
unsigned int prio,
unsigned int flags);
62unsigned int z_soc_irq_get_active(
void);
63void z_soc_irq_eoi(
unsigned int irq);
65#define arch_irq_enable(irq) z_soc_irq_enable(irq)
66#define arch_irq_disable(irq) z_soc_irq_disable(irq)
67#define arch_irq_is_enabled(irq) z_soc_irq_is_enabled(irq)
69#define z_arm_irq_priority_set(irq, prio, flags) \
70 z_soc_irq_priority_set(irq, prio, flags)
74extern void z_arm_int_exit(
void);
76extern void z_arm_interrupt_init(
void);
86#define IRQ_ZERO_LATENCY BIT(0)
88#ifdef CONFIG_CPU_CORTEX_M
90#if defined(CONFIG_ZERO_LATENCY_LEVELS)
91#define ZERO_LATENCY_LEVELS CONFIG_ZERO_LATENCY_LEVELS
93#define ZERO_LATENCY_LEVELS 1
96#define _CHECK_PRIO(priority_p, flags_p) \
97 BUILD_ASSERT(((flags_p & IRQ_ZERO_LATENCY) && \
98 ((ZERO_LATENCY_LEVELS == 1) || \
99 (priority_p < ZERO_LATENCY_LEVELS))) || \
100 (priority_p <= IRQ_PRIO_LOWEST), \
101 "Invalid interrupt priority. Values must not exceed IRQ_PRIO_LOWEST");
103#define _CHECK_PRIO(priority_p, flags_p)
116#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
118 BUILD_ASSERT(IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS) || !(flags_p & IRQ_ZERO_LATENCY), \
119 "ZLI interrupt registered but feature is disabled"); \
120 _CHECK_PRIO(priority_p, flags_p) \
121 Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
122 z_arm_irq_priority_set(irq_p, priority_p, flags_p); \
125#define ARCH_IRQ_DIRECT_CONNECT(irq_p, priority_p, isr_p, flags_p) \
127 BUILD_ASSERT(IS_ENABLED(CONFIG_ZERO_LATENCY_IRQS) || !(flags_p & IRQ_ZERO_LATENCY), \
128 "ZLI interrupt registered but feature is disabled"); \
129 _CHECK_PRIO(priority_p, flags_p) \
130 Z_ISR_DECLARE_DIRECT(irq_p, ISR_FLAG_DIRECT, isr_p); \
131 z_arm_irq_priority_set(irq_p, priority_p, flags_p); \
135extern void _arch_isr_direct_pm(
void);
136#define ARCH_ISR_DIRECT_PM() _arch_isr_direct_pm()
138#define ARCH_ISR_DIRECT_PM() do { } while (false)
141#define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header()
142#define ARCH_ISR_DIRECT_FOOTER(swap) arch_isr_direct_footer(swap)
145extern void z_arm_int_exit(
void);
147#ifdef CONFIG_TRACING_ISR
154#ifdef CONFIG_TRACING_ISR
161#ifdef CONFIG_TRACING_ISR
164 if (maybe_swap != 0) {
169#if defined(__clang__)
170#define ARCH_ISR_DIAG_OFF \
171 _Pragma("clang diagnostic push") \
172 _Pragma("clang diagnostic ignored \"-Wextra\"")
173#define ARCH_ISR_DIAG_ON _Pragma("clang diagnostic pop")
174#elif defined(__GNUC__)
175#define ARCH_ISR_DIAG_OFF \
176 _Pragma("GCC diagnostic push") \
177 _Pragma("GCC diagnostic ignored \"-Wattributes\"")
178#define ARCH_ISR_DIAG_ON _Pragma("GCC diagnostic pop")
180#define ARCH_ISR_DIAG_OFF
181#define ARCH_ISR_DIAG_ON
184#define ARCH_ISR_DIRECT_DECLARE(name) \
185 static inline int name##_body(void); \
187 __attribute__ ((interrupt ("IRQ"))) void name(void) \
189 int check_reschedule; \
190 ISR_DIRECT_HEADER(); \
191 check_reschedule = name##_body(); \
192 ISR_DIRECT_FOOTER(check_reschedule); \
195 static inline int name##_body(void)
197#if defined(CONFIG_DYNAMIC_DIRECT_INTERRUPTS)
199extern void z_arm_irq_direct_dynamic_dispatch_reschedule(
void);
200extern void z_arm_irq_direct_dynamic_dispatch_no_reschedule(
void);
248#define ARM_IRQ_DIRECT_DYNAMIC_CONNECT(irq_p, priority_p, flags_p, resch) \
249 IRQ_DIRECT_CONNECT(irq_p, priority_p, \
250 _CONCAT(z_arm_irq_direct_dynamic_dispatch_, resch), flags_p)
254#if defined(CONFIG_ARM_SECURE_FIRMWARE)
259 IRQ_TARGET_STATE_SECURE = 0,
260 IRQ_TARGET_STATE_NON_SECURE
static void arch_isr_direct_header(void)
Definition: irq.h:91
static void arch_isr_direct_footer(int maybe_swap)
Definition: irq.h:98
#define arch_irq_disable(irq)
Definition: irq.h:107
#define arch_irq_enable(irq)
Definition: irq.h:106
#define arch_irq_is_enabled(irq)
Definition: irq.h:109
void sys_trace_isr_enter(void)
Called when entering an ISR.
void sys_trace_isr_exit(void)
Called when exiting an ISR.
flags
Definition: parser.h:96
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Software-managed ISR table.