14#ifndef ZEPHYR_INCLUDE_ARCH_ARC_V2_IRQ_H_
15#define ZEPHYR_INCLUDE_ARCH_ARC_V2_IRQ_H_
27#define ARC_MP_PRIMARY_CPU_ID 0
31extern void z_arc_firq_stack_set(
void);
35#ifdef CONFIG_TRACING_ISR
40extern void z_irq_priority_set(
unsigned int irq,
unsigned int prio,
51#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
53 Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
54 z_irq_priority_set(irq_p, priority_p, flags_p); \
78#define ARCH_IRQ_DIRECT_CONNECT(irq_p, priority_p, isr_p, flags_p) \
80 Z_ISR_DECLARE_DIRECT(irq_p, ISR_FLAG_DIRECT, isr_p); \
81 BUILD_ASSERT(priority_p || !IS_ENABLED(CONFIG_ARC_FIRQ) || \
82 (IS_ENABLED(CONFIG_ARC_FIRQ_STACK) && \
83 !IS_ENABLED(CONFIG_ARC_STACK_CHECKING)), \
84 "irq priority cannot be set to 0 when CONFIG_ARC_FIRQ_STACK" \
85 "is not configured or CONFIG_ARC_FIRQ_STACK " \
86 "and CONFIG_ARC_STACK_CHECKING are configured together"); \
87 z_irq_priority_set(irq_p, priority_p, flags_p); \
93#ifdef CONFIG_TRACING_ISR
101 if (z_arc_v2_aux_reg_read(_ARC_V2_ICAUSE) ==
102 z_arc_v2_aux_reg_read(_ARC_V2_AUX_IRQ_HINT)) {
103 z_arc_v2_aux_reg_write(_ARC_V2_AUX_IRQ_HINT, 0);
105#ifdef CONFIG_TRACING_ISR
110#define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header()
113#define ARCH_ISR_DIRECT_FOOTER(swap) arch_isr_direct_footer(swap)
116#define _ARC_DIRECT_ISR_FUNC_ATTRIBUTE __interrupt__
118#define _ARC_DIRECT_ISR_FUNC_ATTRIBUTE interrupt("ilink")
125#define ARCH_ISR_DIRECT_DECLARE(name) \
126 static inline int name##_body(void); \
127 __attribute__ ((_ARC_DIRECT_ISR_FUNC_ATTRIBUTE))void name(void) \
129 ISR_DIRECT_HEADER(); \
131 ISR_DIRECT_FOOTER(0); \
133 static inline int name##_body(void)
172 __asm__
volatile(
"clri %0" :
"=r"(key)::
"memory");
178 __asm__
volatile(
"seti %0" : :
"ir"(key) :
"memory");
187 return (key & 0x10) == 0x10;
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 void arch_isr_direct_header(void)
Definition: irq.h:91
static void arch_isr_direct_footer(int maybe_swap)
Definition: irq.h:98
static ALWAYS_INLINE bool arch_irq_unlocked(unsigned int key)
Definition: irq.h:181
#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
ARCv2 auxiliary registers definitions.
Common toolchain abstraction.
#define ALWAYS_INLINE
Definition: common.h:129
void sys_trace_isr_enter(void)
Called when entering an ISR.
void sys_trace_isr_exit(void)
Called when exiting an ISR.
Public interface for configuring interrupts.
flags
Definition: parser.h:96
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Software-managed ISR table.