BUS_DESCRIBE_INTR(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… 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