irq_create_mapping(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, or NULL for the default domain. yes bestie, NULL is 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 πŸ“
  • 0 on 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:

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