Zephyr Project API 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Architecture-specific IRQ APIs

Functions

static bool arch_is_in_isr (void)
 Test if the current context is in interrupt context.
 
static unsigned int arch_irq_lock (void)
 Lock interrupts on the current CPU.
 
static void arch_irq_unlock (unsigned int key)
 Unlock interrupts on the current CPU.
 
static bool arch_irq_unlocked (unsigned int key)
 Test if calling arch_irq_unlock() with this key would unlock irqs.
 
void arch_irq_disable (unsigned int irq)
 Disable the specified interrupt line.
 
void arch_irq_enable (unsigned int irq)
 Enable the specified interrupt line.
 
int arch_irq_is_enabled (unsigned int irq)
 Test if an interrupt line is enabled.
 
int arch_irq_connect_dynamic (unsigned int irq, unsigned int priority, void(*routine)(const void *parameter), const void *parameter, uint32_t flags)
 Arch-specific hook to install a dynamic interrupt.
 
int arch_irq_disconnect_dynamic (unsigned int irq, unsigned int priority, void(*routine)(const void *parameter), const void *parameter, uint32_t flags)
 Arch-specific hook to dynamically uninstall a shared interrupt.
 
unsigned int arch_irq_allocate (void)
 Arch-specific hook for allocating IRQs.
 
void arch_irq_set_used (unsigned int irq)
 Arch-specific hook for declaring an IRQ being used.
 
bool arch_irq_is_used (unsigned int irq)
 Arch-specific hook for checking if an IRQ is being used already.
 

Detailed Description

Function Documentation

◆ arch_irq_allocate()

unsigned int arch_irq_allocate ( void  )

#include <include/zephyr/arch/arch_interface.h>

Arch-specific hook for allocating IRQs.

Note: disable/enable IRQ relevantly inside the implementation of such function to avoid concurrency issues. Also, an allocated IRQ is assumed to be used thus a following

See also
arch_irq_is_used() should return true.
Returns
The newly allocated IRQ or UINT_MAX on error.

◆ arch_irq_connect_dynamic()

int arch_irq_connect_dynamic ( unsigned int  irq,
unsigned int  priority,
void(*)(const void *parameter)  routine,
const void *  parameter,
uint32_t  flags 
)

#include <include/zephyr/arch/arch_interface.h>

Arch-specific hook to install a dynamic interrupt.

Parameters
irqIRQ line number
priorityInterrupt priority
routineInterrupt service routine
parameterISR parameter
flagsArch-specific IRQ configuration flag
Returns
The vector assigned to this interrupt

◆ arch_irq_disable()

void arch_irq_disable ( unsigned int  irq)

#include <include/zephyr/arch/arch_interface.h>

Disable the specified interrupt line.

Note
: The behavior of interrupts that arrive after this call returns and before the corresponding call to arch_irq_enable() is undefined. The hardware is not required to latch and deliver such an interrupt, though on some architectures that may work. Other architectures will simply lose such an interrupt and never deliver it. Many drivers and subsystems are not tolerant of such dropped interrupts and it is the job of the application layer to ensure that behavior remains correct.
See also
irq_disable()

◆ arch_irq_disconnect_dynamic()

int arch_irq_disconnect_dynamic ( unsigned int  irq,
unsigned int  priority,
void(*)(const void *parameter)  routine,
const void *  parameter,
uint32_t  flags 
)

#include <include/zephyr/arch/arch_interface.h>

Arch-specific hook to dynamically uninstall a shared interrupt.

If the interrupt is not being shared, then the associated _sw_isr_table entry will be replaced by (NULL, z_irq_spurious) (default entry).

Parameters
irqIRQ line number
priorityInterrupt priority
routineInterrupt service routine
parameterISR parameter
flagsArch-specific IRQ configuration flag
Returns
0 in case of success, negative value otherwise

◆ arch_irq_enable()

void arch_irq_enable ( unsigned int  irq)

#include <include/zephyr/arch/arch_interface.h>

Enable the specified interrupt line.

See also
irq_enable()

◆ arch_irq_is_enabled()

int arch_irq_is_enabled ( unsigned int  irq)

#include <include/zephyr/arch/arch_interface.h>

Test if an interrupt line is enabled.

See also
irq_is_enabled()

◆ arch_irq_is_used()

bool arch_irq_is_used ( unsigned int  irq)

#include <include/zephyr/arch/arch_interface.h>

Arch-specific hook for checking if an IRQ is being used already.

Parameters
irqthe IRQ to check
Returns
true if being, false otherwise

◆ arch_irq_lock()

static unsigned int arch_irq_lock ( void  )
inlinestatic

#include <include/zephyr/arch/arch_interface.h>

Lock interrupts on the current CPU.

See also
irq_lock()

◆ arch_irq_set_used()

void arch_irq_set_used ( unsigned int  irq)

#include <include/zephyr/arch/arch_interface.h>

Arch-specific hook for declaring an IRQ being used.

Note: disable/enable IRQ relevantly inside the implementation of such function to avoid concurrency issues.

Parameters
irqthe IRQ to declare being used

◆ arch_irq_unlock()

static void arch_irq_unlock ( unsigned int  key)
inlinestatic

#include <include/zephyr/arch/arch_interface.h>

Unlock interrupts on the current CPU.

See also
irq_unlock()

◆ arch_irq_unlocked()

static bool arch_irq_unlocked ( unsigned int  key)
inlinestatic

#include <include/zephyr/arch/arch_interface.h>

Test if calling arch_irq_unlock() with this key would unlock irqs.

Parameters
keyvalue returned by arch_irq_lock()
Returns
true if interrupts were unlocked prior to the arch_irq_lock() call that produced the key argument.

◆ arch_is_in_isr()

static bool arch_is_in_isr ( void  )
inlinestatic

#include <kernel/include/kernel_arch_interface.h>

Test if the current context is in interrupt context.

XXX: This is inconsistently handled among arches wrt exception context See: #17656

Returns
true if we are in interrupt context