include/linux/irqdesc.h
Source file repositories/reference/linux-study-clean/include/linux/irqdesc.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/irqdesc.h- Extension
.h- Size
- 8803 bytes
- Lines
- 283
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/irq_work.hlinux/kobject.hlinux/mutex.hlinux/rcupdate.h
Detected Declarations
struct irq_affinity_notifystruct proc_dir_entrystruct modulestruct irq_descstruct irq_domainstruct pt_regsstruct irqstatstruct irq_redirectstruct irq_descfunction irq_lock_sparsefunction irq_desc_kstat_cpufunction irq_desc_get_irqfunction generic_handle_irq_descfunction irq_desc_has_actionfunction irq_set_typefunction irq_set_chip_handler_name_lockedfunction irq_balancing_disabledfunction irq_is_percpufunction irq_is_percpu_devidfunction irq_set_lockdep_class
Annotated Snippet
struct irqstat {
unsigned int cnt;
#ifdef CONFIG_GENERIC_IRQ_STAT_SNAPSHOT
unsigned int ref;
#endif
};
/**
* struct irq_redirect - interrupt redirection metadata
* @work: Harg irq_work item for handler execution on a different CPU
* @target_cpu: CPU to run irq handler on in case the current CPU is not part
* of the irq affinity mask
*/
struct irq_redirect {
struct irq_work work;
unsigned int target_cpu;
};
/**
* struct irq_desc - interrupt descriptor
* @irq_common_data: per irq and chip data passed down to chip functions
* @kstat_irqs: irq stats per cpu
* @handle_irq: highlevel irq-events handler
* @action: the irq action chain
* @status_use_accessors: status information
* @core_internal_state__do_not_mess_with_it: core internal status information
* @depth: disable-depth, for nested irq_disable() calls
* @wake_depth: enable depth, for multiple irq_set_irq_wake() callers
* @tot_count: stats field for non-percpu irqs
* @last_unhandled: aging timer for unhandled count
* @irq_count: stats field to detect stalled irqs
* @irqs_unhandled: stats field for spurious unhandled interrupts
* @threads_handled: stats field for deferred spurious detection of threaded handlers
* @threads_handled_last: comparator field for deferred spurious detection of threaded handlers
* @lock: locking for SMP
* @redirect: Facility for redirecting interrupts via irq_work
* @affinity_hint: hint to user space for preferred irq affinity
* @affinity_notify: context for notification of affinity changes
* @pending_mask: pending rebalanced interrupts
* @threads_oneshot: bitfield to handle shared oneshot threads
* @threads_active: number of irqaction threads currently running
* @wait_for_threads: wait queue for sync_irq to wait for threaded handlers
* @nr_actions: number of installed actions on this descriptor
* @no_suspend_depth: number of irqactions on a irq descriptor with
* IRQF_NO_SUSPEND set
* @force_resume_depth: number of irqactions on a irq descriptor with
* IRQF_FORCE_RESUME set
* @refcnt: Reference count mainly for /proc/interrupts
* @rcu: rcu head for delayed free
* @kobj: kobject used to represent this struct in sysfs
* @request_mutex: mutex to protect request/free before locking desc->lock
* @dir: /proc/irq/ procfs entry
* @debugfs_file: dentry for the debugfs file
* @name: flow handler name for /proc/interrupts output
*/
struct irq_desc {
struct irq_common_data irq_common_data;
struct irq_data irq_data;
struct irqstat __percpu *kstat_irqs;
irq_flow_handler_t handle_irq;
struct irqaction *action; /* IRQ action list */
unsigned int status_use_accessors;
unsigned int core_internal_state__do_not_mess_with_it;
unsigned int depth; /* nested irq disables */
unsigned int wake_depth; /* nested wake enables */
unsigned long tot_count;
unsigned long last_unhandled; /* Aging timer for unhandled count */
unsigned int irq_count; /* For detecting broken IRQs */
unsigned int irqs_unhandled;
atomic_t threads_handled;
int threads_handled_last;
raw_spinlock_t lock;
struct cpumask *percpu_enabled;
#ifdef CONFIG_SMP
struct irq_redirect redirect;
const struct cpumask *affinity_hint;
struct irq_affinity_notify *affinity_notify;
#ifdef CONFIG_GENERIC_PENDING_IRQ
cpumask_var_t pending_mask;
#endif
#endif
unsigned long threads_oneshot;
atomic_t threads_active;
wait_queue_head_t wait_for_threads;
#ifdef CONFIG_PM_SLEEP
unsigned int nr_actions;
unsigned int no_suspend_depth;
unsigned int cond_suspend_depth;
unsigned int force_resume_depth;
#endif
Annotation
- Immediate include surface: `linux/irq_work.h`, `linux/kobject.h`, `linux/mutex.h`, `linux/rcupdate.h`.
- Detected declarations: `struct irq_affinity_notify`, `struct proc_dir_entry`, `struct module`, `struct irq_desc`, `struct irq_domain`, `struct pt_regs`, `struct irqstat`, `struct irq_redirect`, `struct irq_desc`, `function irq_lock_sparse`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.