request_any_context_irq(9)
π request_any_context_irq(9) π
okay bestie, so this is a page straight outta the Kernel API Manual β the request_any_context_irq(9) entry, and honestly? it's kind of a whole vibe. it's the "idk what kinda IRQ you are but I gotchu" of the kernel. let's get into it π«Ά
β¨ NAME β¨
request_any_context_irq β allocate an interrupt line πΈ
like, you're claiming an interrupt line. that's the whole thing. it's giving reservation-at-a-restaurant energy. π
π¦ SYNOPSIS π¦
int request_any_context_irq (unsigned int irq , irq_handler_t handler ,
unsigned long flags , const char *name , void *dev_id );
five params, no notes, she's iconic. π
π ARGUMENTS π
irqβ the interrupt line you're trying to allocate. literally the number of the IRQ you want. this is the main character here. βhandlerβ the function that gets called when the IRQ actually happens. and lowkey important: for threaded interrupts, this is the threaded handler. so like, know which one you're dealing with. π§flagsβ the interrupt type flags. yeah, those flags. the ones that say what kind of interrupt this is. πnameβ an ascii name for the claiming device. it's literally just a label so everyone knows whose interrupt this is. name your device, bestie, it deserves one. πdev_idβ a cookie passed back to the handler function. yes, an actual cookie (metaphorically). it's the little thing that gets handed back to your handler so it knows what's up. π
π₯ DESCRIPTION π₯
so what does this call even do? okay so:
it allocates the interrupt resources, and then it enables both the interrupt line and IRQ handling. all in one go. ate, honestly.
and here's the slay part β it selects either a hardirq or threaded handling method, depending on the context. so you don't have to pick, she picks for you. it's giving "don't worry your pretty little head about it" energy. πβ¨
ngl the whole point of this one is that it's context-aware, so if you're choosing between this and request_threaded_irq(9), this is the "let the kernel decide" option. periodt.
π RETURN π
- on failure, it returns a negative value. sad. π
- on success, it returns either
IRQC_IS_HARDIRQorIRQC_IS_NESTED. π
so like β check your return value, bestie. negative means go cry about it, and the other two tell you which handling vibe you got. iykyk. π
πΈ SEE ALSO πΈ
first up, the kernel file: ./kernel/irq/manage.c β go read her if you want the behind-the-scenes. π
and then the whole extended friend group, fr fr:
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_nmi(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 gc right there. go say hi. π«Άπ
and that's the page!! mwah π this lil masterpiece lives in ./kernel/irq and it's dated October 2026 β so yeah, she's from the future, obviously. see u next time bestie, stay slaying those interrupts ππβ¨
π¦ 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