BUS_DESCRIBE_INTR(9)
π BUS_DESCRIBE_INTR(9) β the kernel dev manual, bestie edition π
okay so this page lives in the Kernel Developer's Manual and it's literally all about giving your interrupt handlers a name, a personality, a little name tag at the party β¨
πΈ NAME πΈ
BUS_DESCRIBE_INTR, bus_describe_intr β associate a description with an active interrupt handler π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/bus.h>
int
BUS_DESCRIBE_INTR(device_t dev, device_t child, struct resource *irq,
void *cookie, const char *descr);
int
bus_describe_intr(device_t dev, struct resource *irq, void *cookie,
const char *fmt, ...);
π¦ DESCRIPTION π¦
So the BUS_DESCRIBE_INTR() method associates a description with an active interrupt handler, periodt. And like β the cookie parameter must be the value returned by a successful call to BUS_SETUP_INTR(9) for the interrupt irq. no random cookies, bestie π
The bus_describe_intr() function is a simple wrapper around BUS_DESCRIBE_INTR(). As a convenience (and honestly? iconic behaviour π
), bus_describe_intr() lets the caller use printf(9) style formatting to build the description string using fmt.
Now here's the lore π«Ά: when an interrupt handler is established by BUS_SETUP_INTR(9), the handler is named after the device the handler is established for. That name then shows up in various places such as interrupt statistics displayed by systat(1) and vmstat(8). For devices that use a single interrupt, the device name is sufficiently unique to identify the interrupt handler. But for devices that use multiple interrupts? it can be useful to distinguish the interrupt handlers π. And when a description is set for an active interrupt handler, a colon followed by the description is appended to the device name to form the interrupt handler name. so like devname:your cute little descr β the way that's such a serve π
β RETURN VALUES β
Zero is returned on success, otherwise an appropriate error is returned. that's it, that's the vibe check π
π SEE ALSO π
go read them, they're all part of the same friend group π«Άβ¨
π HISTORY π
The BUS_DESCRIBE_INTR() method and bus_describe_intr() functions first appeared in FreeBSD 8.1. a classic, lowkey a legend π
π BUGS π
It is not currently possible to remove a description from an active interrupt handler. so yeah β choose your words wisely, because that descr is forever (until the handler dies) π no take-backsies, fr fr
ngl this page is short but she ate. go forth and name your interrupts, bestie π§π
toodles! πΈ this little rewrite comes to you courtesy of the Debian build of the page, dated December 9, 2015 β mwah ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2009 Hudson River Trading LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms