pci_request_irq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 is 0, not 1, 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 pass NULL here and thread_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's NULL, 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 β€” a printf-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_id must not be NULL and must be globally unique. fr fr. non-negotiable. globally. unique. πŸ’€

🌈 SEE ALSO 🌈

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