subr_bus.c (47167) | subr_bus.c (47178) |
---|---|
1/*- 2 * Copyright (c) 1997,1998 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1997,1998 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: subr_bus.c,v 1.21 1999/05/10 17:06:14 dfr Exp $ | 26 * $Id: subr_bus.c,v 1.22 1999/05/14 09:13:43 dfr Exp $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/queue.h> 31#include <sys/malloc.h> 32#include <sys/kernel.h> 33#include <sys/module.h> 34#include <sys/sysctl.h> --- 1564 unchanged lines hidden (view full) --- 1599} 1600SYSINIT(cfgload, SI_SUB_KMEM, SI_ORDER_ANY + 50, resource_cfgload, 0) 1601 1602 1603/*======================================*/ 1604/* 1605 * Some useful method implementations to make life easier for bus drivers. 1606 */ | 27 */ 28 29#include <sys/param.h> 30#include <sys/queue.h> 31#include <sys/malloc.h> 32#include <sys/kernel.h> 33#include <sys/module.h> 34#include <sys/sysctl.h> --- 1564 unchanged lines hidden (view full) --- 1599} 1600SYSINIT(cfgload, SI_SUB_KMEM, SI_ORDER_ANY + 50, resource_cfgload, 0) 1601 1602 1603/*======================================*/ 1604/* 1605 * Some useful method implementations to make life easier for bus drivers. 1606 */ |
1607 1608/* 1609 * Call DEVICE_IDENTIFY for each driver. 1610 */ |
|
1607int | 1611int |
1612bus_generic_probe(device_t dev) 1613{ 1614 devclass_t dc = dev->devclass; 1615 driverlink_t dl; 1616 1617 for (dl = TAILQ_FIRST(&dc->drivers); dl; dl = TAILQ_NEXT(dl, link)) 1618 DEVICE_IDENTIFY(dl->driver, dev); 1619 1620 return 0; 1621} 1622 1623int |
|
1608bus_generic_attach(device_t dev) 1609{ 1610 device_t child; 1611 1612 for (child = TAILQ_FIRST(&dev->children); 1613 child; child = TAILQ_NEXT(child, link)) 1614 device_probe_and_attach(child); 1615 --- 567 unchanged lines hidden --- | 1624bus_generic_attach(device_t dev) 1625{ 1626 device_t child; 1627 1628 for (child = TAILQ_FIRST(&dev->children); 1629 child; child = TAILQ_NEXT(child, link)) 1630 device_probe_and_attach(child); 1631 --- 567 unchanged lines hidden --- |