iobus.c (103620) | iobus.c (109623) |
---|---|
1/* 2 * Copyright 2002 by Peter Grehan. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/* 2 * Copyright 2002 by Peter Grehan. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/powerpc/psim/iobus.c 103620 2002-09-19 04:57:10Z grehan $ | 27 * $FreeBSD: head/sys/powerpc/psim/iobus.c 109623 2003-01-21 08:56:16Z alfred $ |
28 */ 29 30/* 31 * PSIM 'iobus' local bus. Should be set up in the device tree like: 32 * 33 * /iobus@0x80000000/name psim-iobus 34 * 35 * Code borrowed from various nexus.c and uninorth.c :-) --- 174 unchanged lines hidden (view full) --- 210 */ 211 root = sc->sc_node; 212 213 for (child = OF_child(root); child != 0; child = OF_peer(child)) { 214 OF_getprop_alloc(child, "name", 1, (void **)&name); 215 216 cdev = device_add_child(dev, NULL, -1); 217 if (cdev != NULL) { | 28 */ 29 30/* 31 * PSIM 'iobus' local bus. Should be set up in the device tree like: 32 * 33 * /iobus@0x80000000/name psim-iobus 34 * 35 * Code borrowed from various nexus.c and uninorth.c :-) --- 174 unchanged lines hidden (view full) --- 210 */ 211 root = sc->sc_node; 212 213 for (child = OF_child(root); child != 0; child = OF_peer(child)) { 214 OF_getprop_alloc(child, "name", 1, (void **)&name); 215 216 cdev = device_add_child(dev, NULL, -1); 217 if (cdev != NULL) { |
218 dinfo = malloc(sizeof(*dinfo), M_IOBUS, M_WAITOK); | 218 dinfo = malloc(sizeof(*dinfo), M_IOBUS, 0); |
219 memset(dinfo, 0, sizeof(*dinfo)); 220 resource_list_init(&dinfo->id_resources); 221 dinfo->id_node = child; 222 dinfo->id_name = name; 223 iobus_add_intr(child, dinfo); 224 iobus_add_reg(child, dinfo, sc->sc_addr); 225 device_set_ivars(cdev, dinfo); 226 } else { --- 183 unchanged lines hidden --- | 219 memset(dinfo, 0, sizeof(*dinfo)); 220 resource_list_init(&dinfo->id_resources); 221 dinfo->id_node = child; 222 dinfo->id_name = name; 223 iobus_add_intr(child, dinfo); 224 iobus_add_reg(child, dinfo, sc->sc_addr); 225 device_set_ivars(cdev, dinfo); 226 } else { --- 183 unchanged lines hidden --- |