BUS_READ_IVAR(9)

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

πŸ’… BUS_READ_IVAR(9) πŸ’…

okay bestie, welcome to the Kernel Developer's Manual β€” this page is all about BUS_READ_IVAR(9) and BUS_WRITE_IVAR(9), the two methods for handling bus-specific device instance variables ✨

πŸŽ€ NAME πŸŽ€

BUS_READ_IVAR, BUS_WRITE_IVAR β€” manipulate bus-specific device instance variables, periodt πŸ’…

✨ SYNOPSIS ✨

First, include these, no cap:

#include <sys/param.h>
#include <sys/bus.h>

Then the function signatures, literally:

int
BUS_READ_IVAR(device_t dev, device_t child, int index,
    uintptr_t *result);

int
BUS_WRITE_IVAR(device_t dev, device_t child, int index,
    uintptr_t value);

πŸ’– DESCRIPTION πŸ’–

These two methods manage a bus specific set of instance variables of a child device, and that's the whole vibe 🫢

The intention is that each different type of bus defines a set of appropriate instance variables β€” such as ports and irqs for ISA bus etc. β€” because every bus has its own little personality, iykyk.

This information could be given to the child device as a struct, but that makes it hard for a bus to add or remove variables without forcing an edit and recompile for all drivers, which may not be possible for vendor supplied binary drivers 😭. So yeah, these methods are the move.

⭐ RETURN VALUES ⭐

Zero is returned on success. Otherwise, an appropriate error is returned. That's it, bestie πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

🌸 AUTHORS 🌸

This manual page was written by Doug Rabson. iconic behavior, honestly πŸ’–


okay that's the whole page! made with πŸ’œ β€” source/version: Debian, date: June 16, 1998. bye bestie, go read some ivars πŸŽ€βœ¨

πŸ“¦ where this page comes from