pci_request_irq(9)
π pci_request_irq(9) β the Kernel API Manual, bestie edition π
okay so this is a page from the Kernel API Manual and it's about pci_request_irq, and honestly? it's giving "let me get you an interrupt line, queen." let's go β¨
πΈ NAME πΈ
pci_request_irq β allocate an interrupt line for a PCI device
like, you're literally reserving a hotline for your PCI device to call you on. iconic behavior π
β¨ SYNOPSIS β¨
int pci_request_irq (struct pci_dev *dev , unsigned int nr ,
irq_handler_t handler , irq_handler_t thread_fn , void *dev_id , const
char *fmt , ... );
no cap, that's the whole vibe right there π
π¦ ARGUMENTS π¦
devβ the PCI device you're operating on. your main character π«Άnrβ device-relative interrupt vector index, and it's 0-based (so the first one is0, not1, do not come for me on this).handlerβ the function that gets called when the IRQ happens. also: it's the primary handler for threaded interrupts. and listen π if you passNULLhere andthread_fn != NULL, then the default primary handler gets installed for you. slay, the kernel's got you.thread_fnβ the function called from the IRQ handler thread. if it'sNULL, no IRQ thread is created. periodt.dev_idβ the cookie that gets passed back to the handler function πͺ (yes, real field name, no I'm not kidding)fmtβ aprintf-like format string that names the handler. cute little name tag energy π...β variable arguments, the usual suspects π«
π DESCRIPTION π
so this call is out here allocating interrupt resources and enabling the interrupt line and IRQ handling. and lowkey the important bit: β οΈ from the exact moment you make this call, handler and thread_fn may be invoked. so like... be ready. no take-backs. π
also all interrupts requested using this function might be shared β sharing is caring, iykyk π€
and the big one:
dev_idmust not beNULLand must be globally unique. fr fr. non-negotiable. globally. unique. π
π SEE ALSO π
- Kernel file
./drivers/pci/irq.c pci_free_irq(9)pci_swizzle_interrupt_pin(9)pci_common_swizzle(9)pci_check_and_mask_intx(9)pci_check_and_unmask_intx(9)pcibios_penalize_isa_irq(9)
go read those next, bestie, the lore is deep π§ββοΈ
and that's the whole page! π this little gem lives in ./drivers/pci, dated October 2026, and it's filed under pci_request_irq(9). mwah π go request some IRQs responsibly, ily, bye! ππβ¨
π¦ 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