|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Macros | |
| #define | ARCH_IRQ_CONNECT(irq, pri, isr, arg, flags) |
| Arch-specific hook for statically connecting an interrupt. | |
| #define | ARCH_PCIE_IRQ_CONNECT(bdf, irq, pri, isr, arg, flags) |
| Arch-specific hook for connecting a PCIe endpoint interrupt. | |
| #define | ARCH_IRQ_DIRECT_CONNECT(irq_p, priority_p, isr_p, flags_p) |
| Arch-specific hook for statically connecting a direct interrupt. | |
| #define | ARCH_ISR_DIRECT_PM() |
| Arch-specific hook for power management in a direct ISR. | |
| #define | ARCH_ISR_DIRECT_HEADER() |
| Arch-specific bookkeeping on direct interrupt entry. | |
| #define | ARCH_ISR_DIRECT_FOOTER(swap) |
| Arch-specific bookkeeping on direct interrupt exit. | |
| #define | ARCH_ISR_DIRECT_DECLARE(name) |
| Arch-specific hook for declaring a direct interrupt service routine. | |
| #define | ARCH_EXCEPT(reason_p) |
| Generate a software induced fatal error. | |
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. | |
| static bool | arch_cpu_irqs_are_enabled (void) |
| Probe the current CPU overall interrupt controller lock state without modifying it. | |
| 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. | |
| #define ARCH_EXCEPT | ( | reason_p | ) |
#include <arch_interface.h>
Generate a software induced fatal error.
If the caller is running in user mode, only K_ERR_KERNEL_OOPS or K_ERR_STACK_CHK_FAIL may be induced.
This should ideally generate a software trap, with exception context indicating state when this was invoked. General purpose register state at the time of trap should not be disturbed from the calling context.
| reason_p | K_ERR_ scoped reason code for the fatal error. |
| #define ARCH_IRQ_CONNECT | ( | irq, | |
| pri, | |||
| isr, | |||
| arg, | |||
| flags ) |
#include <arch_interface.h>
Arch-specific hook for statically connecting an interrupt.
Statically populate the interrupt tables at build time such that isr is invoked with arg as its argument when interrupt irq fires, with interrupt priority pri and architecture-specific configuration flags. All arguments must be usable in a constant expression context.
| irq | Interrupt line number |
| pri | Interrupt priority |
| isr | Interrupt service routine |
| arg | Argument passed to the ISR |
| flags | Arch-specific IRQ configuration flags |
| #define ARCH_IRQ_DIRECT_CONNECT | ( | irq_p, | |
| priority_p, | |||
| isr_p, | |||
| flags_p ) |
#include <arch_interface.h>
Arch-specific hook for statically connecting a direct interrupt.
As for ARCH_IRQ_CONNECT(), but for an ISR declared with ARCH_ISR_DIRECT_DECLARE() that is installed to bypass the common software ISR dispatch for minimum latency. Direct ISRs take no argument.
| irq_p | Interrupt line number |
| priority_p | Interrupt priority |
| isr_p | Direct interrupt service routine |
| flags_p | Arch-specific IRQ configuration flags |
| #define ARCH_ISR_DIRECT_DECLARE | ( | name | ) |
#include <arch_interface.h>
Arch-specific hook for declaring a direct interrupt service routine.
Declare a function name suitable for installation with ARCH_IRQ_DIRECT_CONNECT(), wrapping the function body that follows such that ARCH_ISR_DIRECT_HEADER() and ARCH_ISR_DIRECT_FOOTER() run around it and any architecture-specific ISR prologue/epilogue (such as interrupt attributes) is applied. The wrapped body returns non-zero if a context switch may be performed on interrupt exit.
| name | Name of the direct interrupt service routine to declare |
| #define ARCH_ISR_DIRECT_FOOTER | ( | swap | ) |
#include <arch_interface.h>
Arch-specific bookkeeping on direct interrupt exit.
Counterpart to ARCH_ISR_DIRECT_HEADER(): undo the interrupt-entry bookkeeping and, if swap is non-zero, check whether a context switch is needed on interrupt exit and arrange for it. Invoked at the end of every direct ISR through ISR_DIRECT_FOOTER().
| swap | Non-zero if a context switch may be performed on exit |
| #define ARCH_ISR_DIRECT_HEADER | ( | ) |
#include <arch_interface.h>
Arch-specific bookkeeping on direct interrupt entry.
Perform the interrupt-entry bookkeeping that the common interrupt dispatch path would otherwise do, such as tracking interrupt nesting and emitting tracing events. Invoked at the top of every direct ISR through ISR_DIRECT_HEADER().
| #define ARCH_ISR_DIRECT_PM | ( | ) |
#include <arch_interface.h>
Arch-specific hook for power management in a direct ISR.
Perform the power management bookkeeping that the common interrupt dispatch path would otherwise do (such as exiting a low-power idle state). Direct ISRs that may interrupt the idle loop invoke this through ISR_DIRECT_PM().
| #define ARCH_PCIE_IRQ_CONNECT | ( | bdf, | |
| irq, | |||
| pri, | |||
| isr, | |||
| arg, | |||
| flags ) |
#include <arch_interface.h>
Arch-specific hook for connecting a PCIe endpoint interrupt.
As for ARCH_IRQ_CONNECT(), but for an interrupt belonging to the PCIe endpoint identified by bdf, so the architecture may resolve the final interrupt vector from the endpoint at build or run time.
| bdf | PCIe endpoint bus/device/function identifier |
| irq | Interrupt line number |
| pri | Interrupt priority |
| isr | Interrupt service routine |
| arg | Argument passed to the ISR |
| flags | Arch-specific IRQ configuration flags |
|
inlinestatic |
#include <arch_interface.h>
Probe the current CPU overall interrupt controller lock state without modifying it.
Unlike arch_irq_unlocked() which inspects a saved key, this reports the instantaneous state of the calling CPU's overall interrupt enable.
| unsigned int arch_irq_allocate | ( | void | ) |
#include <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
This API is only used when no PCIe controller driver is enabled (
CONFIG_PCIE_CONTROLLER
); with a controller driver, IRQ allocation is handled by the controller instead.
| int arch_irq_connect_dynamic | ( | unsigned int | irq, |
| unsigned int | priority, | ||
| void(* | routine )(const void *parameter), | ||
| const void * | parameter, | ||
| uint32_t | flags ) |
#include <arch_interface.h>
Arch-specific hook to install a dynamic interrupt.
| irq | IRQ line number |
| priority | Interrupt priority |
| routine | Interrupt service routine |
| parameter | ISR parameter |
| flags | Arch-specific IRQ configuration flag |
| void arch_irq_disable | ( | unsigned int | irq | ) |
#include <arch_interface.h>
Disable the specified interrupt line.
| int arch_irq_disconnect_dynamic | ( | unsigned int | irq, |
| unsigned int | priority, | ||
| void(* | routine )(const void *parameter), | ||
| const void * | parameter, | ||
| uint32_t | flags ) |
#include <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).
| irq | IRQ line number |
| priority | Interrupt priority |
| routine | Interrupt service routine |
| parameter | ISR parameter |
| flags | Arch-specific IRQ configuration flag |
| void arch_irq_enable | ( | unsigned int | irq | ) |
| int arch_irq_is_enabled | ( | unsigned int | irq | ) |
#include <arch_interface.h>
Arch-specific hook for checking if an IRQ is being used already.
| irq | the IRQ to check |
|
inlinestatic |
| void arch_irq_set_used | ( | unsigned int | irq | ) |
#include <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.
| irq | the IRQ to declare being used |
|
inlinestatic |
#include <arch_interface.h>
Test if calling arch_irq_unlock() with this key would unlock irqs.
| key | value returned by arch_irq_lock() |
|
inlinestatic |
#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