summaryrefslogtreecommitdiffstats
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2012-08-10 15:02:49 +0000
committerhselasky <hselasky@FreeBSD.org>2012-08-10 15:02:49 +0000
commit3ccdeed50760f5c01b649834ab49f50f7ae5872b (patch)
treef2d07ce3573fe7542f1582ab309e5d65b25be685 /sys/sys/bus.h
parentfd073d8747e8941e1c70a3204040745a69d43b5c (diff)
downloadFreeBSD-src-3ccdeed50760f5c01b649834ab49f50f7ae5872b.zip
FreeBSD-src-3ccdeed50760f5c01b649834ab49f50f7ae5872b.tar.gz
Add new device method to free the automatically
allocated softc structure which is returned by device_get_softc(). This method can be used to easily implement softc refcounting. This can be desirable when the softc has memory references which are controlled by userspace handles for example. This solves the problem of blocking the caller of device_detach() for a non-deterministic time. Discussed with: kib, ed MFC after: 2 weeks
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 1d6f37e..941819a 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -468,6 +468,7 @@ int device_set_unit(device_t dev, int unit); /* XXX DONT USE XXX */
int device_shutdown(device_t dev);
void device_unbusy(device_t dev);
void device_verbose(device_t dev);
+void device_free_softc(device_t dev, void *softc);
/*
* Access functions for devclass.
OpenPOWER on IntegriCloud