STRUCT IRQ_DOMAIN_OPS(9)
π 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. returns1on a match. classic matchmaker energy πselectβ matches an interrupt controller fw specification. it's more generic thanmatchbecause it receives a completestruct irq_fwspec. so like,selectis preferred if provided π returns1on 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β allocatesnr_irqsinterrupts starting fromvirq.freeβ freesnr_irqsinterrupts starting fromvirq.activateβ activates one interrupt in HW (irqd). ifreserveis set, only reserve the vector. if unset, assign the vector (called fromrequest_irq). βdeactivateβ disarms one interrupt (irqd).translateβ givenfwspec, decodes the hardware irq number (out_hwirq) and linux irq type value (out_type). this is a generalisedxlate(overstruct irq_fwspec) and is preferred if provided π₯get_fwspec_infoβ givenfwspec, reports additional firmware-provided information ininfo. 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:
struct irq_fwspec(9)struct irq_fwspec_info(9)struct irq_domain(9)struct irq_domain_info(9)irq_domain_create_linear(9)irq_create_mapping(9)irq_resolve_mapping(9)irq_find_mapping(9)irq_domain_create_hierarchy(9)irq_domain_alloc_irqs(9)
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
- 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