BUS_BIND_INTR(9)
π BUS_BIND_INTR β bestie, let's pin that interrupt π
ok so this is a page from the Kernel Developer's Manual, section 9. Yes it's the BUS_BIND_INTR one. Come sit with me, this is actually so good.
β¨ NAME β¨
BUS_BIND_INTR, bus_bind_intr β bind an interrupt resource to a specific CPU π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/bus.h>
int
BUS_BIND_INTR(device_t dev, device_t child, struct resource *irq,
int cpu);
int
bus_bind_intr(device_t dev, struct resource *irq, int cpu);
π¦ DESCRIPTION π¦
okay so the BUS_BIND_INTR() method lets you pin an interrupt resource to one specific CPU. like, "this one. only this one. periodt." π
heads up bestie: the interrupt resource must already have an interrupt handler attached via BUS_SETUP_INTR(9). No handler, no binding, that's the vibe check.
The cpu parameter is the ID of a valid CPU in the system.
Here's what binding actually does, fr fr:
- it restricts the
cpuset(2)of any associated interrupt threads so they only include the specified CPU - it may also direct the low-level interrupt handling of the interrupt to the specified CPU as well β but this behavior is platform-dependent, so don't @ me
And if you pass NOCPU as the value for cpu? Then the interrupt gets βunboundβ π which restores any associated interrupt threads back to the default cpuset. undoing the binding, iconic behavior.
β οΈ Non-sleepable locks such as mutexes should not be held across calls to these functions. like literally do not do that. π
The bus_bind_intr() function is just a simple wrapper around BUS_BIND_INTR(). tiny, adorable, does the same thing. π«Ά
Note that currently there is no attempt made to arbitrate between multiple bind requests for the same interrupt β whether from the same device or from multiple devices. Also? There is no arbitration between interrupt binding requests submitted by userland via cpuset(2) and BUS_BIND_INTR(). So who wins?
The most recent binding request is the one that will be in effect. Last one in the group chat decides. that's the rule. π
β RETURN VALUES β
Zero on success, bestie. β¨ Otherwise, an appropriate error is returned. π
π SEE ALSO π
π HISTORY π
The BUS_BIND_INTR() method and the bus_bind_intr() functions first appeared in FreeBSD 7.2. throwback era honestly.
ok that's the whole page, you ate that π this one came from the Debian crew and it's dated October 14, 2009 β so yes, this lore is old but it's still giving main character energy. go bind something (safely) π¦β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2009 Hudson River Trading LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms