STRUCT IRQ_CHIP(9)
๐ struct irq_chip(9) โ Kernel API Manual โจ
okay bestie, so this page is from the Kernel API Manual and it's literally the blueprint for struct irq_chip โ the hardware interrupt chip descriptor ๐ like, this is the thing that tells the kernel how to actually talk to your interrupt controller. main character energy fr fr.
โจ NAME โจ
struct irq_chip โ hardware interrupt chip descriptor ๐
๐ฆ SYNOPSIS ๐ฆ
struct irq_chip {
const char *name;
unsigned int (*irq_startup)(struct irq_data *data);
void (*irq_shutdown)(struct irq_data *data);
void (*irq_enable)(struct irq_data *data);
void (*irq_disable)(struct irq_data *data);
void (*irq_ack)(struct irq_data *data);
void (*irq_mask)(struct irq_data *data);
void (*irq_mask_ack)(struct irq_data *data);
void (*irq_unmask)(struct irq_data *data);
void (*irq_eoi)(struct irq_data *data);
int (*irq_set_affinity)(struct irq_data *data, const struct cpumask
*void (*irq_pre_redirect)(struct irq_data *data);
int (*irq_retrigger)(struct irq_data *data);
int (*irq_set_type)(struct irq_data *data, unsigned int flow_type);
int (*irq_set_wake)(struct irq_data *data, unsigned int on);
void (*irq_bus_lock)(struct irq_data *data);
void (*irq_bus_sync_unlock)(struct irq_data *data);
#ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE;
void (*irq_cpu_online)(struct irq_data *data);
void (*irq_cpu_offline)(struct irq_data *data);
#endif;
void (*irq_suspend)(struct irq_data *data);
void (*irq_resume)(struct irq_data *data);
void (*irq_pm_shutdown)(struct irq_data *data);
void (*irq_calc_mask)(struct irq_data *data);
void (*irq_print_chip)(struct irq_data *data, struct seq_file *p);
int (*irq_request_resources)(struct irq_data *data);
void (*irq_release_resources)(struct irq_data *data);
void (*irq_compose_msi_msg)(struct irq_data *data, struct msi_msg
*msg);
void (*irq_write_msi_msg)(struct irq_data *data, struct msi_msg
*msg);
int (*irq_get_irqchip_state)(struct irq_data *data, enum
irqchip_irq_state which, bool *state);
int (*irq_set_irqchip_state)(struct irq_data *data, enum
irqchip_irq_state which, bool state);
int (*irq_set_vcpu_affinity)(struct irq_data *data, void
*vcpu_info);
void (*ipi_send_single)(struct irq_data *data, unsigned int cpu);
void (*ipi_send_mask)(struct irq_data *data, const struct cpumask
*dest);
int (*irq_nmi_setup)(struct irq_data *data);
void (*irq_nmi_teardown)(struct irq_data *data);
void (*irq_force_complete_move)(struct irq_data *data);
unsigned long flags;
};
okay tiny thing โ my copy above is a scuffed render of the synopsis (the irq_set_affinity line and a few * line-wraps got eaten by the void ๐ญ). The real deal, character for character, is:
struct irq_chip {
const char *name;
unsigned int (*irq_startup)(struct irq_data *data);
void (*irq_shutdown)(struct irq_data *data);
void (*irq_enable)(struct irq_data *data);
void (*irq_disable)(struct irq_data *data);
void (*irq_ack)(struct irq_data *data);
void (*irq_mask)(struct irq_data *data);
void (*irq_mask_ack)(struct irq_data *data);
void (*irq_unmask)(struct irq_data *data);
void (*irq_eoi)(struct irq_data *data);
int (*irq_set_affinity)(struct irq_data *data, const struct cpumask
*dest, bool force);
void (*irq_pre_redirect)(struct irq_data *data);
int (*irq_retrigger)(struct irq_data *data);
int (*irq_set_type)(struct irq_data *data, unsigned int flow_type);
int (*irq_set_wake)(struct irq_data *data, unsigned int on);
void (*irq_bus_lock)(struct irq_data *data);
void (*irq_bus_sync_unlock)(struct irq_data *data);
#ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE;
void (*irq_cpu_online)(struct irq_data *data);
void (*irq_cpu_offline)(struct irq_data *data);
#endif;
void (*irq_suspend)(struct irq_data *data);
void (*irq_resume)(struct irq_data *data);
void (*irq_pm_shutdown)(struct irq_data *data);
void (*irq_calc_mask)(struct irq_data *data);
void (*irq_print_chip)(struct irq_data *data, struct seq_file *p);
int (*irq_request_resources)(struct irq_data *data);
void (*irq_release_resources)(struct irq_data *data);
void (*irq_compose_msi_msg)(struct irq_data *data, struct msi_msg
*msg);
void (*irq_write_msi_msg)(struct irq_data *data, struct msi_msg
*msg);
int (*irq_get_irqchip_state)(struct irq_data *data, enum
irqchip_irq_state which, bool *state);
int (*irq_set_irqchip_state)(struct irq_data *data, enum
irqchip_irq_state which, bool state);
int (*irq_set_vcpu_affinity)(struct irq_data *data, void
*vcpu_info);
void (*ipi_send_single)(struct irq_data *data, unsigned int cpu);
void (*ipi_send_mask)(struct irq_data *data, const struct cpumask
*dest);
int (*irq_nmi_setup)(struct irq_data *data);
void (*irq_nmi_teardown)(struct irq_data *data);
void (*irq_force_complete_move)(struct irq_data *data);
unsigned long flags;
};
๐ธ Members ๐ธ
okay now the good part โ every single member, no skips, periodt ๐
nameโ the name that shows up in/proc/interrupts. it's giving name tag at a party ๐irq_startupโ starts up the interrupt. and if it'sNULL, it defaults to->enable. love a fallback bestie ๐ซถirq_shutdownโ shuts the interrupt down.NULL? defaults to->disable. same energy ๐irq_enableโ turns the interrupt on. defaults tochip->unmaskifNULL. the chain of command is real ๐ฅirq_disableโ turns the interrupt off. bye bestie ๐irq_ackโ start of a new interrupt. fresh start, clean slate โจirq_maskโ mask an interrupt source ๐irq_mask_ackโ ack and mask an interrupt source. multitasking icon ๐irq_unmaskโ unmask an interrupt source. come back out, we miss you ๐ฆirq_eoiโ end of interrupt. that's a wrap, folks ๐ฌirq_set_affinityโ sets the CPU affinity on SMP machines. if theforceargument is true, it tells the driver to unconditionally apply the affinity setting โ and no, sanity checks against the supplied affinity mask are not required in that case. this one gets used for CPU hotplug, where the target CPU isn't incpu_online_maskyet. literally the VIP pass of affinity ๐irq_pre_redirectโ optional function that gets invoked before redirecting an interrupt viairq_work. and heads up: it's called only onCONFIG_SMPโ ๏ธirq_retriggerโ resends an IRQ to the CPU. rerun the episode ๐irq_set_typeโ sets the flow type of an IRQ (IRQ_TYPE_LEVEL/etc.) ๐irq_set_wakeโ enables/disables power-management wake-on for an IRQ ๐ดirq_bus_lockโ function to lock access to slow bus (i2c) chips ๐irq_bus_sync_unlockโ function to sync and unlock slow bus (i2c) chips. sync + unlock, the duo ๐ซฑ๐ซฒirq_cpu_onlineโ configure an interrupt source for a secondary CPU ๐irq_cpu_offlineโ un-configure an interrupt source for a secondary CPU ๐irq_suspendโ function called from core code on suspend, once per chip, when one or more interrupts are installed ๐irq_resumeโ function called from core code on resume, once per chip, when one ore more interrupts are installed โ๏ธ (and yes, "ore" โ that's exactly how it's spelled in the original, i'm not fixing it, it's iconic ๐ญ)irq_pm_shutdownโ function called from core code on shutdown, once per chip ๐irq_calc_maskโ optional function to setirq_data.maskfor special cases ๐งฎirq_print_chipโ optional, prints special chip info inshow_interrupts๐จ๏ธirq_request_resourcesโ optional, requests resources before calling any other callback related to this irq ๐irq_release_resourcesโ optional, releases resources acquired withirq_request_resources. give it back ๐ซถirq_compose_msi_msgโ optional, composes message content for MSI โ๏ธirq_write_msi_msgโ optional, writes message content for MSI ๐irq_get_irqchip_stateโ returns the internal state of an interrupt ๐irq_set_irqchip_stateโ sets the internal state of a interrupt ๐๏ธirq_set_vcpu_affinityโ optional, targets a vCPU in a virtual machine ๐ฅ๏ธipi_send_singleโ sends a single IPI to destination cpus ๐จipi_send_maskโ sends an IPI to destination cpus incpumask๐ฌirq_nmi_setupโ function called from core code before enabling an NMI โกirq_nmi_teardownโ function called from core code after disabling an NMI ๐งนirq_force_complete_moveโ optional function to force complete a pending irq move ๐flagsโ chip specific flags ๐ฉ
lowkey important: a bunch of these are marked optional โ that's not me being cute, that's straight from the page. if a chip doesn't need it, it just doesn't fill it in. no pressure bestie ๐
๐ SEE ALSO ๐
go read these next, they're all in the kernel file ./include/linux/irq.h:
struct irq_common_data(9)struct irq_data(9)struct irq_chip_regs(9)struct irq_chip_type(9)struct irq_chip_generic(9)enum irq_gc_flags(9)struct irq_domain_chip_generic_info(9)
okay that's the whole page, you ate that ๐ this lil gem lives in ./include/linux and it's dated October 2026 โ so yeah, coming to a kernel near you, no cap ๐ catch you in the next man page, mwah ๐งโจ
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms