include/linux/irq.h
Source file repositories/reference/linux-study-clean/include/linux/irq.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/irq.h- Extension
.h- Size
- 44325 bytes
- Lines
- 1309
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cache.hlinux/spinlock.hlinux/cpumask.hlinux/irqhandler.hlinux/irqreturn.hlinux/irqnr.hlinux/topology.hlinux/io.hlinux/slab.hasm/irq.hasm/ptrace.hasm/irq_regs.hlinux/irqdesc.hasm/hw_irq.h
Detected Declarations
struct seq_filestruct modulestruct msi_msgstruct irq_affinity_descstruct msi_descstruct irq_domainstruct irq_common_datastruct irq_datastruct irq_chipstruct irq_chip_regsstruct irq_chip_typestruct irq_chip_genericstruct irq_domain_chip_genericstruct irq_domain_chip_generic_infostruct irq_matrixenum irqchip_irq_stateenum irq_gc_flagsfunction irqd_is_setaffinity_pendingfunction irqd_is_per_cpufunction irqd_can_balancefunction irqd_affinity_was_setfunction irqd_mark_affinity_was_setfunction irqd_trigger_type_was_setfunction irqd_get_trigger_typefunction irqd_set_trigger_typefunction irqd_is_level_typefunction irqd_set_single_targetfunction irqd_is_single_targetfunction irqd_set_handle_enforce_irqctxfunction irqd_is_handle_enforce_irqctxfunction irqd_is_enabled_on_suspendfunction irqd_is_wakeup_setfunction irqd_irq_disabledfunction irqd_irq_maskedfunction irqd_irq_inprogressfunction irqd_is_wakeup_armedfunction irqd_is_forwarded_to_vcpufunction irqd_set_forwarded_to_vcpufunction irqd_clr_forwarded_to_vcpufunction irqd_affinity_is_managedfunction irqd_is_activatedfunction irqd_set_activatedfunction irqd_clr_activatedfunction irqd_is_startedfunction irqd_is_managed_and_shutdownfunction irqd_set_can_reservefunction irqd_clr_can_reservefunction irqd_can_reserve
Annotated Snippet
struct irq_common_data {
unsigned int __private state_use_accessors;
#ifdef CONFIG_NUMA
unsigned int node;
#endif
void *handler_data;
struct msi_desc *msi_desc;
#ifdef CONFIG_SMP
cpumask_var_t affinity;
#endif
#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
cpumask_var_t effective_affinity;
#endif
#ifdef CONFIG_GENERIC_IRQ_IPI
unsigned int ipi_offset;
#endif
};
/**
* struct irq_data - per irq chip data passed down to chip functions
* @mask: precomputed bitmask for accessing the chip registers
* @irq: interrupt number
* @hwirq: hardware interrupt number, local to the interrupt domain
* @common: point to data shared by all irqchips
* @chip: low level interrupt hardware access
* @domain: Interrupt translation domain; responsible for mapping
* between hwirq number and linux irq number.
* @parent_data: pointer to parent struct irq_data to support hierarchy
* irq_domain
* @chip_data: platform-specific per-chip private data for the chip
* methods, to allow shared chip implementations
*/
struct irq_data {
u32 mask;
unsigned int irq;
irq_hw_number_t hwirq;
struct irq_common_data *common;
struct irq_chip *chip;
struct irq_domain *domain;
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
struct irq_data *parent_data;
#endif
void *chip_data;
};
/*
* Bit masks for irq_common_data.state_use_accessors
*
* IRQD_TRIGGER_MASK - Mask for the trigger type bits
* IRQD_SETAFFINITY_PENDING - Affinity setting is pending
* IRQD_ACTIVATED - Interrupt has already been activated
* IRQD_NO_BALANCING - Balancing disabled for this IRQ
* IRQD_PER_CPU - Interrupt is per cpu
* IRQD_AFFINITY_SET - Interrupt affinity was set
* IRQD_LEVEL - Interrupt is level triggered
* IRQD_WAKEUP_STATE - Interrupt is configured for wakeup
* from suspend
* IRQD_IRQ_DISABLED - Disabled state of the interrupt
* IRQD_IRQ_MASKED - Masked state of the interrupt
* IRQD_IRQ_INPROGRESS - In progress state of the interrupt
* IRQD_WAKEUP_ARMED - Wakeup mode armed
* IRQD_FORWARDED_TO_VCPU - The interrupt is forwarded to a VCPU
* IRQD_AFFINITY_MANAGED - Affinity is auto-managed by the kernel
* IRQD_IRQ_STARTED - Startup state of the interrupt
* IRQD_MANAGED_SHUTDOWN - Interrupt was shutdown due to empty affinity
* mask. Applies only to affinity managed irqs.
* IRQD_SINGLE_TARGET - IRQ allows only a single affinity target
* IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set
* IRQD_CAN_RESERVE - Can use reservation mode
* IRQD_HANDLE_ENFORCE_IRQCTX - Enforce that handle_irq_*() is only invoked
* from actual interrupt context.
* IRQD_AFFINITY_ON_ACTIVATE - Affinity is set on activation. Don't call
* irq_chip::irq_set_affinity() when deactivated.
* IRQD_IRQ_ENABLED_ON_SUSPEND - Interrupt is enabled on suspend by irq pm if
* irqchip have flag IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND set.
* IRQD_RESEND_WHEN_IN_PROGRESS - Interrupt may fire when already in progress in which
* case it must be resent at the next available opportunity.
*/
enum {
IRQD_TRIGGER_MASK = 0xf,
IRQD_SETAFFINITY_PENDING = BIT(8),
IRQD_ACTIVATED = BIT(9),
IRQD_NO_BALANCING = BIT(10),
IRQD_PER_CPU = BIT(11),
IRQD_AFFINITY_SET = BIT(12),
IRQD_LEVEL = BIT(13),
IRQD_WAKEUP_STATE = BIT(14),
IRQD_IRQ_DISABLED = BIT(16),
IRQD_IRQ_MASKED = BIT(17),
IRQD_IRQ_INPROGRESS = BIT(18),
Annotation
- Immediate include surface: `linux/cache.h`, `linux/spinlock.h`, `linux/cpumask.h`, `linux/irqhandler.h`, `linux/irqreturn.h`, `linux/irqnr.h`, `linux/topology.h`, `linux/io.h`.
- Detected declarations: `struct seq_file`, `struct module`, `struct msi_msg`, `struct irq_affinity_desc`, `struct msi_desc`, `struct irq_domain`, `struct irq_common_data`, `struct irq_data`, `struct irq_chip`, `struct irq_chip_regs`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.