irq_create_mapping(9)
π irq_create_mapping β a page from the Kernel API Manual, bestie
okay so picture this: you've got a hardware interrupt just vibing out there in hardware-land, and it has zero idea that linux irq space even exists. that's the whole crisis this function solves. it's giving matchmaker energy. π
β¨ NAME β¨
irq_create_mapping β Map a hardware interrupt into linux irq space π¦
like, literally, it takes your hardware interrupt and gets it a spot in linux irq space. no cap.
πΈ SYNOPSIS πΈ
unsigned int irq_create_mapping (struct irq_domain *domain ,
irq_hw_number_t hwirq );
that's the whole thing. two args, one unsigned int coming back at you. iconic. π
π«Ά ARGUMENTS π«Ά
domainβ the domain that owns this hardware interrupt, orNULLfor the default domain. yes bestie,NULLis allowed, it's not a typo, it means "default domain, please" β¨hwirqβ the hardware irq number in that domain space. important: it's in the domain's own numbering, not linux's. keep that straight or the vibe check fails π
π DESCRIPTION π
okay so the number one rule, and I mean it, write it on your mirror:
Only one mapping per hardware interrupt is permitted.
one hardware interrupt β one mapping. that's it. that's the deal. don't come back later trying to double-book it, because it will not slay. π
and then β and this is the part people forget β if the sense/trigger is to be specified, set_irq_type should be called on the number returned from that call. like, the number that comes back from irq_create_mapping. that's the handle you feed to set_irq_type. don't guess, don't invent your own number, use the returned one. π₯
fr fr: this page does not say what happens if you try to map the same hwirq twice β it just says only one mapping per hardware interrupt is permitted. so don't. π
π RETURN π
- Linux irq number β the good ending, you ate π
0on error β the bad ending, no irq for you, check your args bestie π
π SEE ALSO π
Kernel file ./include/linux/irqdomain.h β plus the whole squad, all of them, in the order the page lists them:
struct irq_fwspec(9)struct irq_fwspec_info(9)struct irq_domain_ops(9)struct irq_domain(9)struct irq_domain_info(9)irq_domain_create_linear(9)irq_resolve_mapping(9)irq_find_mapping(9)irq_domain_create_hierarchy(9)irq_domain_alloc_irqs(9)
that's a full friend group, honestly. go read them, they're all main character energy in their own way π
and that's the tea π§ from ./include/linux, dated October 2026 β go map those interrupts responsibly, bestie, 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