DEVICE_GET_IVARS(9)
π DEVICE_GET_IVARS(9) π
okay bestie, welcome to the device_get_ivars / device_set_ivars page from the Kernel Developer's Manual β¨ this one's short and sweet but it's lowkey important, so let's get into it π«Ά
πΈ NAME πΈ
device_get_ivars, device_set_ivars β access bus private variables π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/bus.h>
void *
device_get_ivars(device_t dev);
void
device_set_ivars(device_t dev, void *ivar);
π¦ DESCRIPTION π¦
so the way this works: device_get_ivars() hands you back the bus-specific instance variables of a device. it's giving "here's your stuff, bestie" π
and then device_set_ivars() is the reverse β it sets the bus-specific instance variables of a device. iconic duo fr fr π
ngl, typically only bus drivers use these functions. the kernel is literally assuming that the bus driver is gonna manage this memory β there is no automatic memory allocation or deallocation happening here. none. zero. not a crumb. π
so if you're a client driver, please don't come through here β you should be accessing ivars through the BUS_READ_IVAR(9) interface instead. that's the vibe check, and you passed it π
π SEE ALSO π
π AUTHORS π
this manual page was written by Doug Rabson. thank you Doug, we are obsessed π«Άβ¨
and that's a wrap, bestie π¦ this page came to you from Debian, dated June 16, 1998 β vintage fr, main character energy from the very start ππ slay, mwah π
π¦ 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) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms