kernel/irq/internals.h
Source file repositories/reference/linux-study-clean/kernel/irq/internals.h
File Facts
- System
- Linux kernel
- Corpus path
kernel/irq/internals.h- Extension
.h- Size
- 12021 bytes
- Lines
- 398
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- 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/irqdesc.hlinux/kernel_stat.hlinux/pm_runtime.hlinux/rcuref.hlinux/sched/clock.hdebugfs.hproc.hdebug.hsettings.h
Detected Declarations
function irq_mark_irqfunction irq_desc_get_reffunction irq_desc_put_reffunction irq_desc_get_reffunction irq_desc_put_reffunction register_irq_procfunction irq_setup_affinityfunction chip_bus_lockfunction chip_bus_sync_unlockfunction class_irqdesc_lock_constructorfunction irqd_getfunction irqd_set_move_pendingfunction irqd_clr_move_pendingfunction irqd_set_managed_shutdownfunction irqd_clr_managed_shutdownfunction irqd_clearfunction irqd_setfunction irqd_has_setfunction irq_state_set_disabledfunction irq_state_set_maskedfunction __kstat_incr_irqs_this_cpufunction kstat_incr_irqs_this_cpufunction irq_desc_get_nodefunction irq_desc_is_chainedfunction irq_is_nmifunction irq_pm_handle_wakeupfunction irq_init_generic_chipfunction irq_move_pendingfunction irq_copy_pendingfunction irq_get_pendingfunction irq_can_move_pcntxtfunction irq_move_pendingfunction irq_copy_pendingfunction irq_fixup_move_pendingfunction irq_force_complete_movefunction irq_domain_deactivate_irq
Annotated Snippet
static __always_inline void irq_mark_irq(unsigned int irq) { }
void irq_desc_free_rcu(struct irq_desc *desc);
static __always_inline bool irq_desc_get_ref(struct irq_desc *desc)
{
return rcuref_get(&desc->refcnt);
}
static __always_inline void irq_desc_put_ref(struct irq_desc *desc)
{
if (rcuref_put(&desc->refcnt))
irq_desc_free_rcu(desc);
}
#else
extern void irq_mark_irq(unsigned int irq);
static __always_inline bool irq_desc_get_ref(struct irq_desc *desc) { return true; }
static __always_inline void irq_desc_put_ref(struct irq_desc *desc) { }
#endif
irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc);
irqreturn_t handle_irq_event_percpu(struct irq_desc *desc);
irqreturn_t handle_irq_event(struct irq_desc *desc);
/* Resending of interrupts :*/
int check_irq_resend(struct irq_desc *desc, bool inject);
void clear_irq_resend(struct irq_desc *desc);
void irq_resend_init(struct irq_desc *desc);
void __irq_wake_thread(struct irq_desc *desc, struct irqaction *action);
void wake_threads_waitq(struct irq_desc *desc);
#ifdef CONFIG_PROC_FS
extern void register_irq_proc(unsigned int irq, struct irq_desc *desc);
extern void unregister_irq_proc(unsigned int irq, struct irq_desc *desc);
extern void register_handler_proc(unsigned int irq, struct irqaction *action);
extern void unregister_handler_proc(unsigned int irq, struct irqaction *action);
void irq_proc_update_valid(struct irq_desc *desc);
#else
static inline void register_irq_proc(unsigned int irq, struct irq_desc *desc) { }
static inline void unregister_irq_proc(unsigned int irq, struct irq_desc *desc) { }
static inline void register_handler_proc(unsigned int irq,
struct irqaction *action) { }
static inline void unregister_handler_proc(unsigned int irq,
struct irqaction *action) { }
static inline void irq_proc_update_valid(struct irq_desc *desc) { }
#endif
struct irq_desc *irq_find_desc_at_or_after(unsigned int offset);
extern bool irq_can_set_affinity_usr(unsigned int irq);
extern int irq_do_set_affinity(struct irq_data *data,
const struct cpumask *dest, bool force);
extern void irq_affinity_schedule_notify_work(struct irq_desc *desc);
#ifdef CONFIG_SMP
extern int irq_setup_affinity(struct irq_desc *desc);
#else
static inline int irq_setup_affinity(struct irq_desc *desc) { return 0; }
#endif
#define for_each_action_of_desc(desc, act) \
for (act = desc->action; act; act = act->next)
/* Inline functions for support of irq chips on slow busses */
static inline void chip_bus_lock(struct irq_desc *desc)
{
if (unlikely(desc->irq_data.chip->irq_bus_lock))
desc->irq_data.chip->irq_bus_lock(&desc->irq_data);
}
static inline void chip_bus_sync_unlock(struct irq_desc *desc)
{
if (unlikely(desc->irq_data.chip->irq_bus_sync_unlock))
desc->irq_data.chip->irq_bus_sync_unlock(&desc->irq_data);
}
#define _IRQ_DESC_CHECK (1 << 0)
#define _IRQ_DESC_PERCPU (1 << 1)
#define IRQ_GET_DESC_CHECK_GLOBAL (_IRQ_DESC_CHECK)
#define IRQ_GET_DESC_CHECK_PERCPU (_IRQ_DESC_CHECK | _IRQ_DESC_PERCPU)
struct irq_desc *__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
unsigned int check);
void __irq_put_desc_unlock(struct irq_desc *desc, unsigned long flags, bool bus);
__DEFINE_CLASS_IS_CONDITIONAL(irqdesc_lock, true);
__DEFINE_UNLOCK_GUARD(irqdesc_lock, struct irq_desc,
if (_T->lock) __irq_put_desc_unlock(_T->lock, _T->flags, _T->bus),
Annotation
- Immediate include surface: `linux/irqdesc.h`, `linux/kernel_stat.h`, `linux/pm_runtime.h`, `linux/rcuref.h`, `linux/sched/clock.h`, `debugfs.h`, `proc.h`, `debug.h`.
- Detected declarations: `function irq_mark_irq`, `function irq_desc_get_ref`, `function irq_desc_put_ref`, `function irq_desc_get_ref`, `function irq_desc_put_ref`, `function register_irq_proc`, `function irq_setup_affinity`, `function chip_bus_lock`, `function chip_bus_sync_unlock`, `function class_irqdesc_lock_constructor`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- 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.