11#ifndef ZEPHYR_INCLUDE_IRQ_MULTILEVEL_H_
12#define ZEPHYR_INCLUDE_IRQ_MULTILEVEL_H_
22#if defined(CONFIG_MULTI_LEVEL_INTERRUPTS) || defined(__DOXYGEN__)
34 CONFIG_1ST_LEVEL_INTERRUPT_BITS;
36 (CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS);
38 if (
IS_ENABLED(CONFIG_3RD_LEVEL_INTERRUPTS) && (irq & mask3) != 0) {
42 if (
IS_ENABLED(CONFIG_2ND_LEVEL_INTERRUPTS) && (irq & mask2) != 0) {
62 return ((irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) &
63 BIT_MASK(CONFIG_2ND_LEVEL_INTERRUPT_BITS)) - 1;
65 return (irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) - 1;
76#define IRQ_TO_L2(irq) ((irq + 1) << CONFIG_1ST_LEVEL_INTERRUPT_BITS)
107 return irq &
BIT_MASK(CONFIG_1ST_LEVEL_INTERRUPT_BITS);
123 return (irq >> (CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS)) - 1;
133#define IRQ_TO_L3(irq) \
134 ((irq + 1) << (CONFIG_1ST_LEVEL_INTERRUPT_BITS + CONFIG_2ND_LEVEL_INTERRUPT_BITS))
165 return (irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) &
166 BIT_MASK(CONFIG_2ND_LEVEL_INTERRUPT_BITS);
#define IS_ENABLED(config_macro)
Check for macro definition in compiler-visible expressions.
Definition: util_macro.h:124
#define BIT_MASK(n)
Bit mask with bits 0 through n-1 (inclusive) set, or 0 if n is 0.
Definition: util_macro.h:68
#define IRQ_TO_L3(irq)
Preprocessor macro to convert irq from level 1 to level 3 format.
Definition: irq_multilevel.h:133
static unsigned int irq_to_level_3(unsigned int irq)
Converts irq from level 1 to level 3 format.
Definition: irq_multilevel.h:148
static unsigned int irq_from_level_3(unsigned int irq)
Return the 3rd level interrupt number.
Definition: irq_multilevel.h:121
static unsigned int irq_from_level_2(unsigned int irq)
Return the 2nd level interrupt number.
Definition: irq_multilevel.h:59
static unsigned int irq_get_level(unsigned int irq)
Return IRQ level This routine returns the interrupt level number of the provided interrupt.
Definition: irq_multilevel.h:31
static unsigned int irq_to_level_2(unsigned int irq)
Converts irq from level 1 to level 2 format.
Definition: irq_multilevel.h:90
#define IRQ_TO_L2(irq)
Preprocessor macro to convert irq from level 1 to level 2 format.
Definition: irq_multilevel.h:76
static unsigned int irq_parent_level_2(unsigned int irq)
Returns the parent IRQ of the level 2 raw IRQ number.
Definition: irq_multilevel.h:105
static unsigned int irq_parent_level_3(unsigned int irq)
Returns the parent IRQ of the level 3 raw IRQ number.
Definition: irq_multilevel.h:163
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90