request_nmi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… request_nmi(9) β€” like, the NMI line allocator ✨

okay so first things first, this is request_nmi(9) from the Kernel API Manual β€” yes, the big serious kernel docs, but we're gonna make it make sense, bestie 🫢


✨ NAME ✨

request_nmi β€” allocate an interrupt line for NMI delivery πŸŽ€

🌸 SYNOPSIS 🌸

int request_nmi (unsigned int irq , irq_handler_t handler , unsigned
long irqflags , const char *name , void *dev_id );

like, that's the whole vibe. five things in, one int out πŸ’œ

πŸ¦‹ ARGUMENTS πŸ¦‹

  • irq β€” the interrupt line you're allocating. the main character of this whole operation πŸ‘‘
  • handler β€” the function that gets called when the IRQ happens. and yeah, for threaded interrupts this is the threaded handler, no cap 🧡
  • irqflags β€” the interrupt type flags. the little settings that say what kind of interrupt this is ✨
  • name β€” an ascii name for the claiming device. gotta claim it, gotta name it πŸ’…
  • dev_id β€” a cookie πŸͺ that gets passed right back to your handler function. it comes back to you, fr fr

πŸ”₯ DESCRIPTION πŸ”₯

so this call allocates interrupt resources and enables the interrupt line AND the IRQ handling. literally does both. and the key part: it sets up the IRQ line to be handled as an NMI ⭐

okay now the rules, because there are rules and they are not optional:

  • An interrupt line delivering NMIs cannot be shared, periodt. no sharing, not even with your bestie πŸ™…β€β™€οΈ
  • IRQ handling cannot be threaded. not a thing. don't try it πŸ’€
  • Interrupt lines requested for NMI delivering must produce per cpu interrupts and must have auto enabling setting disabled. both. non-negotiable βœ‹

dev_id must be globally unique 🌈 normally people just use the address of the device data structure as the cookie, and honestly that makes sense since the handler receives this value β€” so like, why wouldn't you πŸŽ€

and if the interrupt line just can't be used to deliver NMIs? the function fails and returns a negative value 😭 that's your vibe check failing, sorry babes.

🧚 SEE ALSO 🧚

a whole friend group of kernel file ./kernel/irq/manage.c plus all these icons πŸ‘‘:

like, that's the whole group chat, go say hi πŸ’–


and that's the page!! brought to you by ./kernel/irq, dated October 2026 β€” screenshot it, save it, frame it, slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from