INTR_BARRIER(9)

πŸ“¦ in nixpkgs unstable

πŸ’… INTR_BARRIER β€” interrupt barrier, bestie

okay so bestie, welcome to intr_barrier β€” it's a kernel thing (the man page lives in section 9 of the Kernel Developer's Manual, iykyk), and honestly? she's lowkey iconic for how much she does with so little.


🌸 NAME 🌸

intr_barrier β€” interrupt barrier ✨

Like, a barrier. For interrupts. That's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <machine/intr.h>

void
intr_barrier(void *ih);

that's it. that's the whole signature. no cap. 🫢


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, and it is good tea. β˜•

intr_barrier() guarantees that any interrupt handler invocations for the interrupt handler specified by ih have finished before it returns. literally β€” every single invocation, done, wrapped, finished, no stragglers, before this function hands control back to you. periodt. πŸ’…

and the way that ih works is: the cookie you pass to intr_barrier() should be the value returned when the interrupt handler was established β€” for example, the return value of pci_intr_establish(9). so like, don't just make up a cookie, bestie. use the one they gave you. πŸ™ˆ


πŸ”₯ CONTEXT πŸ”₯

so like, where can you even call this? good news:

intr_barrier() can be called from process context. 🫢

that's the whole section. she's short but she ate. πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€

go read these next, they're friends of hers:

  • pci_intr_establish(9) β€” where your ih cookie comes from in the first place πŸ’–
  • spl(9) β€” the other classic interrupt-adjacent baddie ✨

⚠️ friendly reminder: pass the actual cookie from when the handler was established. a random pointer is not giving what you think it's giving. πŸ’€

and that's the whole page, bestie!! this lil slice of kernel lore is brought to you by Debian, dated September 13, 2015 β€” yeah she's vintage, she's a classic, she's still serving. πŸŒˆπŸ’œ go forth and barrier your interrupts responsibly. mwah. πŸ“

πŸ“¦ where this page comes from