STRUCT IRQ_CHIP(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… 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's NULL, 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 to chip->unmask if NULL. 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 the force argument 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 in cpu_online_mask yet. literally the VIP pass of affinity ๐Ÿ’…
  • irq_pre_redirect โ€” optional function that gets invoked before redirecting an interrupt via irq_work. and heads up: it's called only on CONFIG_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 set irq_data.mask for special cases ๐Ÿงฎ
  • irq_print_chip โ€” optional, prints special chip info in show_interrupts ๐Ÿ–จ๏ธ
  • irq_request_resources โ€” optional, requests resources before calling any other callback related to this irq ๐ŸŽ’
  • irq_release_resources โ€” optional, releases resources acquired with irq_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 in cpumask ๐Ÿ“ฌ
  • 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