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);
69void z_arc_v2_irq_unit_int_enable(
int irq)
71 z_arc_v2_irq_unit_irq_enable_set(irq, _ARC_V2_INT_ENABLE);
81void z_arc_v2_irq_unit_int_disable(
int irq)
83 z_arc_v2_irq_unit_irq_enable_set(irq, _ARC_V2_INT_DISABLE);
95bool z_arc_v2_irq_unit_int_enabled(
int irq)
100 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
101 ret = z_arc_v2_aux_reg_read(_ARC_V2_IRQ_ENABLE) & 0x1;
116void z_arc_v2_irq_unit_prio_set(
int irq,
unsigned char prio)
121 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
122#if defined(CONFIG_ARC_SECURE_FIRMWARE)
123 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY,
124 (z_arc_v2_aux_reg_read(_ARC_V2_IRQ_PRIORITY) & (~_ARC_V2_INT_PRIO_MASK))
127 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY, prio);
132#if defined(CONFIG_ARC_SECURE_FIRMWARE)
139void z_arc_v2_irq_uinit_secure_set(
int irq,
bool secure)
143 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
146 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY,
147 z_arc_v2_aux_reg_read(_ARC_V2_IRQ_PRIORITY) |
148 _ARC_V2_IRQ_PRIORITY_SECURE);
150 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_PRIORITY,
151 z_arc_v2_aux_reg_read(_ARC_V2_IRQ_PRIORITY) &
152 _ARC_V2_INT_PRIO_MASK);
169void z_arc_v2_irq_unit_sensitivity_set(
int irq,
int s)
173 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
174 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_TRIGGER,
s);
187bool z_arc_v2_irq_unit_is_in_isr(
void)
189 uint32_t act = z_arc_v2_aux_reg_read(_ARC_V2_AUX_IRQ_ACT);
192 if (z_arc_v2_aux_reg_read(_ARC_V2_STATUS32) & _ARC_V2_STATUS32_AE) {
196 return ((act & 0xffff) != 0U);
207void z_arc_v2_irq_unit_trigger_set(
int irq,
unsigned int trigger)
211 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
212 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_TRIGGER, trigger);
226unsigned int z_arc_v2_irq_unit_trigger_get(
int irq)
231 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
232 ret = z_arc_v2_aux_reg_read(_ARC_V2_IRQ_TRIGGER);
246void z_arc_v2_irq_unit_int_eoi(
int irq)
250 z_arc_v2_aux_reg_write(_ARC_V2_IRQ_SELECT, irq);
251 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:129
static ZTEST_BMEM int ret
Definition main.c:16
static k_spinlock_key_t key
Definition spinlock_error_case.c:15
__UINT32_TYPE__ uint32_t
Definition stdint.h:90