STRUCT IRQ_DOMAIN_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct irq_domain_ops β€” Kernel API Manual, section 9

okay bestie, gather round 🫢 this is the page for struct irq_domain_ops, and it lives in section 9 of the Kernel API Manual. it's literally the vtable of "methods for irq_domain objects" β€” like, the personality pack a driver hands to its irq_domain so the core knows who to call. let's get into it ✨


🌸 NAME 🌸

struct irq_domain_ops β€” methods for irq_domain objects. that's the whole vibe. no cap.


✨ SYNOPSIS ✨

like, here's the actual struct, character for character, don't @ me about the stray semicolons, that's just how the page renders πŸ™ˆ

struct irq_domain_ops {
    int (*match)(struct irq_domain *d, struct device_node *node, enum irq_domain_bus_token bus_token);
    int (*select)(struct irq_domain *d, struct irq_fwspec *fwspec, enum irq_domain_bus_token bus_token);
    int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw);
    void (*unmap)(struct irq_domain *d, unsigned int virq);
    int (*xlate)(struct irq_domain *d, struct device_node *node, const u32 *intspec, unsigned int intsize, unsigned long *out_hwirq, unsigned int *out_type);
  #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY;
    int (*alloc)(struct irq_domain *d, unsigned int virq, unsigned int nr_irqs, void *arg);
    void (*free)(struct irq_domain *d, unsigned int virq, unsigned int nr_irqs);
    int (*activate)(struct irq_domain *d, struct irq_data *irqd, bool reserve);
    void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data);
    int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec, unsigned long *out_hwirq, unsigned int *out_type);
    int (*get_fwspec_info)(struct irq_fwspec *fwspec, struct irq_fwspec_info *info);
  #endif;
  #ifdef CONFIG_GENERIC_IRQ_DEBUGFS;
    void (*debug_show)(struct seq_file *m, struct irq_domain *d, struct irq_data *irqd, int ind);
  #endif;
 };

πŸŽ€ MEMBERS πŸŽ€

  • match β€” matches an interrupt controller device node to a domain. returns 1 on a match. classic matchmaker energy πŸ’–
  • select β€” matches an interrupt controller fw specification. it's more generic than match because it receives a complete struct irq_fwspec. so like, select is preferred if provided πŸ‘‘ returns 1 on a match.
  • map β€” creates or updates a mapping between a virtual irq number and a hw irq number. this gets called only once for a given mapping, so don't be weird about it 🫢
  • unmap β€” disposes of such a mapping. it's the breakup arc πŸ’€
  • xlate β€” given a device tree node and interrupt specifier, decodes the hardware irq number and linux irq type value. the translator bestie 🧚
  • alloc β€” allocates nr_irqs interrupts starting from virq.
  • free β€” frees nr_irqs interrupts starting from virq.
  • activate β€” activates one interrupt in HW (irqd). if reserve is set, only reserve the vector. if unset, assign the vector (called from request_irq). ⭐
  • deactivate β€” disarms one interrupt (irqd).
  • translate β€” given fwspec, decodes the hardware irq number (out_hwirq) and linux irq type value (out_type). this is a generalised xlate (over struct irq_fwspec) and is preferred if provided πŸ”₯
  • get_fwspec_info β€” given fwspec, reports additional firmware-provided information in info. optional, so no pressure bestie 🌸
  • debug_show β€” for domains to show specific data for an interrupt in debugfs. peek behind the curtain vibes πŸ¦‹

🌈 DESCRIPTION 🌈

okay so the functions below are provided by the driver, and they get called whenever a new mapping is created or an old mapping is disposed. so your driver can then go ahead and do whatever internal data structures management it requires β€” that's your business, i don't judge πŸ’…

it also needs to setup the irq_desc when returning from map. like, that's the assignment, don't skip it 😭


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./include/linux/irqdomain.h β€” and the whole friend group:


ngl this page is from the ./include/linux corner of the tree, and the date on it is October 2026. that's the whole footer, so like β€” consider it mentioned, mwah πŸ’‹

anyway that's the page, you ate that reading it, periodt πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from