diff options
author | dfr <dfr@FreeBSD.org> | 1999-03-29 08:54:20 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1999-03-29 08:54:20 +0000 |
commit | e92e9c75bfcb1d32e9a6da832e0288caef0abd4a (patch) | |
tree | d56b9573f9c1710544ea3b0ac9249a916228c0ed /sys/kern/bus_if.m | |
parent | 21b8cdbbc44555e6e72a62f039cb74083fa94385 (diff) | |
download | FreeBSD-src-e92e9c75bfcb1d32e9a6da832e0288caef0abd4a.zip FreeBSD-src-e92e9c75bfcb1d32e9a6da832e0288caef0abd4a.tar.gz |
Add some useful functions to the device framework:
* bus_setup_intr() as a wrapper for BUS_SETUP_INTR
* bus_teardown_intr() as a wrapper for BUS_TEARDOWN_INTR
* device_get_nameunit() which returns e.g. "foo0" for name "foo" and unit 0.
* device_set_desc_copy() malloc a copy of the description string.
* device_quiet(), device_is_quiet(), device_verbose() suppress probe message.
Add one method to the BUS interface, BUS_CHILD_DETACHED() which is called
after the child has been detached to allow the bus to clean up any memory
which it allocated on behalf of the child.
I also fixed a bug which corrupted the list of drivers in a devclass if
a driver was added to more than one devclass.
Diffstat (limited to 'sys/kern/bus_if.m')
-rw-r--r-- | sys/kern/bus_if.m | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m index fd4f648..8c48082 100644 --- a/sys/kern/bus_if.m +++ b/sys/kern/bus_if.m @@ -23,7 +23,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id: bus_if.m,v 1.4 1998/11/08 18:51:38 nsouch Exp $ +# $Id: bus_if.m,v 1.5 1998/11/14 21:58:51 wollman Exp $ # INTERFACE bus; @@ -71,6 +71,15 @@ METHOD int write_ivar { }; # +# Called after the child's DEVICE_DETACH method to allow the parent +# to reclaim any resources allocated on behalf of the child. +# +METHOD void child_detached { + device_t dev; + device_t child; +}; + +# # Allocate a system resource attached to `dev' on behalf of `child'. # The types are defined in <machine/resource.h>; the meaning of the # resource-ID field varies from bus to bus (but *rid == 0 is always |