generic_handle_domain_nmi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… generic_handle_domain_nmi β€” Kernel API Manual, bestie edition ✨

Okay so picture this: you're deep in the kernel, you've got a hardware NMI that belongs to a domain, and somebody's gotta actually invoke the handler for it. That's this function. It's giving "middle management for interrupts" and honestly it ate. πŸŽ€


🌸 NAME 🌸

generic_handle_domain_nmi β€” invoke the handler for a HW nmi belonging to a domain. That's it, that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

int generic_handle_domain_nmi (struct irq_domain *domain ,
       irq_hw_number_t hwirq );

Like, look at her. Two args, one int return, no drama. πŸ”₯


🫢 ARGUMENTS 🫢

  • domain β€” the domain where to perform the lookup. This is your "where am I even" parameter. πŸ‘‘
  • hwirq β€” the HW irq number to convert to a logical one. It's the hardware's raw little number, and we're translating it into something the kernel can actually work with. No cap. πŸ’…

πŸ’– RETURN πŸ’–

0 on success (slay), or -EINVAL if conversion has failed 😭 β€” which, lowkey, means the lookup didn't work out. It's not you, it's the numbers.


🌈 DESCRIPTION 🌈

So here's the important part, and I need you to listen: this function must be called from an NMI context with irq regs initialized. Not optional. Not "if you feel like it." It's a whole requirement, periodt. πŸ™ˆ

No fr fr, if you're not in NMI context with the irq regs initialized, this is not the function for you. Read the room.

🧚 SEE ALSO 🧚

Kernel file ./kernel/irq/irqdesc.c β€” go read it, bestie, it's iconic:


And that's the whole page! Mwah πŸ’‹ β€” this gem lives in ./kernel/irq and the docs are stamped October 2026, so if you're reading this from the future, hi, hope the irq regs are initialized. πŸ“βœ¨

πŸ“¦ where this page comes from