request_nmi(9)
π 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 π:
synchronize_hardirq(9),synchronize_irq(9),irq_can_set_affinity(9)irq_can_set_affinity_usr(9),irq_set_thread_affinity(9),irq_affinity_schedule_notify_work(9)irq_update_affinity_desc(9),irq_set_affinity(9),irq_force_affinity(9)irq_set_affinity_notifier(9),irq_set_vcpu_affinity(9)disable_irq_nosync(9),disable_irq(9),disable_hardirq(9),disable_nmi_nosync(9)enable_irq(9),enable_nmi(9)irq_set_irq_wake(9),irq_wake_thread(9)free_irq(9),request_threaded_irq(9),request_any_context_irq(9)irq_percpu_is_enabled(9),free_percpu_irq(9),request_percpu_irq_affinity(9)request_percpu_nmi(9),prepare_percpu_nmi(9),teardown_percpu_nmi(9)irq_get_irqchip_state(9),irq_set_irqchip_state(9)irq_has_action(9),irq_check_status_bit(9)
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
- 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