summaryrefslogtreecommitdiffstats
path: root/share/man/man9/device_get_softc.9
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-03-28 07:28:31 +0000
committerimp <imp@FreeBSD.org>2003-03-28 07:28:31 +0000
commit5d5d5f775ce468bcb7dd450a586fdd2a7f51d71f (patch)
tree21275aa647b173927d7c91c84c7fb824aa6faf84 /share/man/man9/device_get_softc.9
parent572bed9dc2eb3195de616e869d21a51cf7b289d8 (diff)
downloadFreeBSD-src-5d5d5f775ce468bcb7dd450a586fdd2a7f51d71f.zip
FreeBSD-src-5d5d5f775ce468bcb7dd450a586fdd2a7f51d71f.tar.gz
Expound a little bit about the softc, where its size is found and a
caution against emulating legacy softc methods used in the tree.
Diffstat (limited to 'share/man/man9/device_get_softc.9')
-rw-r--r--share/man/man9/device_get_softc.918
1 files changed, 16 insertions, 2 deletions
diff --git a/share/man/man9/device_get_softc.9 b/share/man/man9/device_get_softc.9
index f180a49..74816d01 100644
--- a/share/man/man9/device_get_softc.9
+++ b/share/man/man9/device_get_softc.9
@@ -40,11 +40,25 @@
.Ft void *
.Fn device_get_softc "device_t dev"
.Sh DESCRIPTION
-Return the driver-specific instance variables of a device.
+Return the driver-specific state of
+.Fa dev .
+The softc is automatically allocated the first time it is requested.
+The size of the allocation is determined by the device's
+.Ft driver_t
+information used to define the driver.
+The softc typically encaposlates the state of this instance of the
+device.
+.Pp
+Driver writers are discouraged from using their own softc management
+mechanisms.
+Driver writers should not copy such mechanisms found in drivers in the
+tree that predates this function.
.Sh RETURN VALUES
The pointer to the driver-specific instance variable is returned.
.Sh SEE ALSO
-.Xr device 9
+.Xr driver 9 ,
+.Xr device 9 ,
+.Xr device_set_softc 9
.Sh AUTHORS
This man page was written by
.An Doug Rabson .
OpenPOWER on IntegriCloud