DEVICE_GET_SOFTC(9)
π DEVICE_GET_SOFTC(9) β access driver private instance variables π
(okay bestie, this one is from the Kernel Developer's Manual β and it's literally about grabbing a driver's private instance-variable pointer β¨)
πΈ NAME πΈ
device_get_softc β access driver private instance variables
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <sys/bus.h>
void *
device_get_softc(device_t dev);
π¦ DESCRIPTION π¦
So device_get_softc(dev) returns the driver-specific software context of dev. The softc is automatically allocated and zeroed when the device is attached. π
It's also initialized and present when a device is probed, but there are caveats β those are described in DEVICE_PROBE(9). π
The size of the allocation is determined by the device's driver_t information used to define the driver. The softc typically encapsulates the state of this instance of the device. π
β οΈ real talk, bestie: driver writers are discouraged from using their own softc management mechanisms. And they should not copy such mechanisms found in drivers in the tree that predate this function. no cap. π
π RETURN VALUES π
The pointer to the driver-specific instance variable is returned. that's it, that's the vibe. π«Ά
π₯ SEE ALSO π₯
device(9)DEVICE_PROBE(9)device_set_softc(9)driver(9)
π AUTHORS π
This manual page was written by Doug Rabson. iconic. π
π that's the whole page, bestie. source/version vibes: Debian, dated January 21, 2015, and the manpage tag is DEVICE_GET_SOFTC(9) β periodt. π
β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms