10#ifndef ZEPHYR_INCLUDE_ARCH_ARC_V2_ARCV2_IRQ_UNIT_H_
11#define ZEPHYR_INCLUDE_ARCH_ARC_V2_ARCV2_IRQ_UNIT_H_
18#define _ARC_V2_INT_PRIO_MASK 0xf
19#define _ARC_V2_INT_DISABLE 0
20#define _ARC_V2_INT_ENABLE 1
22#define _ARC_V2_INT_LEVEL 0
23#define _ARC_V2_INT_PULSE 1
49void z_arc_v2_irq_unit_irq_enable_set(
56 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
57 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_ENABLE, enable);
71void z_arc_v2_irq_unit_int_enable(
int irq)
73 z_arc_v2_irq_unit_irq_enable_set(irq, _ARC_V2_INT_ENABLE);
85void z_arc_v2_irq_unit_int_disable(
int irq)
87 z_arc_v2_irq_unit_irq_enable_set(irq, _ARC_V2_INT_DISABLE);
99bool z_arc_v2_irq_unit_int_enabled(
int irq)
104 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
105 ret = z_arc_v2_aux_reg_read(_ARC_V2_IRQ_ENABLE) & 0x1;
122void z_arc_v2_irq_unit_prio_set(
int irq,
unsigned char prio)
127 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
128#if defined(CONFIG_ARC_SECURE_FIRMWARE)
129 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY,
130 (z_arc_v2_aux_reg_read(_ARC_V2_IRQ_PRIORITY) & (~_ARC_V2_INT_PRIO_MASK))
133 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY, prio);
138#if defined(CONFIG_ARC_SECURE_FIRMWARE)
147void z_arc_v2_irq_uinit_secure_set(
int irq,
bool secure)
151 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
154 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY,
155 z_arc_v2_aux_reg_read(_ARC_V2_IRQ_PRIORITY) |
156 _ARC_V2_IRQ_PRIORITY_SECURE);
158 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY,
159 z_arc_v2_aux_reg_read(_ARC_V2_IRQ_PRIORITY) &
160 _ARC_V2_INT_PRIO_MASK);
179void z_arc_v2_irq_unit_sensitivity_set(
int irq,
int s)
183 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
184 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_TRIGGER,
s);
197bool z_arc_v2_irq_unit_is_in_isr(
void)
199 uint32_t act = z_arc_v2_aux_reg_read(_ARC_V2_AUX_IRQ_ACT);
202 if (z_arc_v2_aux_reg_read(_ARC_V2_STATUS32) & _ARC_V2_STATUS32_AE) {
206 return ((act & 0xffff) != 0U);
219void z_arc_v2_irq_unit_trigger_set(
int irq,
unsigned int trigger)
223 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
224 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_TRIGGER, trigger);
238unsigned int z_arc_v2_irq_unit_trigger_get(
int irq)
243 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
244 ret = z_arc_v2_aux_reg_read(_ARC_V2_IRQ_TRIGGER);
260void z_arc_v2_irq_unit_int_eoi(
int irq)
264 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
265 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PULSE_CANCEL, 1);
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
irp nz macro MOVR cc s mov cc s endm endr irp aw macro LDR aa s
Definition: asm-macro-32-bit-gnu.h:17
#define ALWAYS_INLINE
Definition: common.h:116
static ZTEST_BMEM volatile int ret
Definition: k_float_disable.c:28
static k_spinlock_key_t key
Definition: spinlock_error_case.c:14
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60