Deleted Added
full compact
ebus.c (152684) ebus.c (154870)
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001 Thomas Moestl <tmm@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001 Thomas Moestl <tmm@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 16 unchanged lines hidden (view full) ---

25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/sparc64/ebus/ebus.c 152684 2005-11-22 16:39:44Z marius $");
33__FBSDID("$FreeBSD: head/sys/sparc64/ebus/ebus.c 154870 2006-01-26 21:14:32Z marius $");
34
35/*
36 * UltraSPARC 5 and beyond Ebus support.
37 *
38 * note that this driver is not complete:
39 * - ebus2 dma code is completely unwritten
40 * - interrupt establish is written and appears to work
41 * - bus map code is written and appears to work

--- 69 unchanged lines hidden (view full) ---

111 phandle_t);
112static void ebus_destroy_dinfo(struct ebus_devinfo *);
113static int ebus_print_res(struct ebus_devinfo *);
114
115static device_method_t ebus_methods[] = {
116 /* Device interface */
117 DEVMETHOD(device_probe, ebus_probe),
118 DEVMETHOD(device_attach, ebus_attach),
34
35/*
36 * UltraSPARC 5 and beyond Ebus support.
37 *
38 * note that this driver is not complete:
39 * - ebus2 dma code is completely unwritten
40 * - interrupt establish is written and appears to work
41 * - bus map code is written and appears to work

--- 69 unchanged lines hidden (view full) ---

111 phandle_t);
112static void ebus_destroy_dinfo(struct ebus_devinfo *);
113static int ebus_print_res(struct ebus_devinfo *);
114
115static device_method_t ebus_methods[] = {
116 /* Device interface */
117 DEVMETHOD(device_probe, ebus_probe),
118 DEVMETHOD(device_attach, ebus_attach),
119 DEVMETHOD(device_shutdown, bus_generic_shutdown),
120 DEVMETHOD(device_suspend, bus_generic_suspend),
121 DEVMETHOD(device_resume, bus_generic_resume),
119
120 /* Bus interface */
121 DEVMETHOD(bus_print_child, ebus_print_child),
122 DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch),
123 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
124 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
125 DEVMETHOD(bus_alloc_resource, ebus_alloc_resource),
126 DEVMETHOD(bus_get_resource_list, ebus_get_resource_list),

--- 294 unchanged lines hidden (view full) ---

421 nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs),
422 (void **)&intrs);
423 for (i = 0; i < nintr; i++) {
424 rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, intrs[i]);
425 if (rintr == PCI_INVALID_IRQ) {
426 device_printf(dev,
427 "<%s>: could not map EBus interrupt %d\n",
428 edi->edi_obdinfo.obd_name, intrs[i]);
122
123 /* Bus interface */
124 DEVMETHOD(bus_print_child, ebus_print_child),
125 DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch),
126 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
127 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
128 DEVMETHOD(bus_alloc_resource, ebus_alloc_resource),
129 DEVMETHOD(bus_get_resource_list, ebus_get_resource_list),

--- 294 unchanged lines hidden (view full) ---

424 nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intrs),
425 (void **)&intrs);
426 for (i = 0; i < nintr; i++) {
427 rintr = ofw_isa_route_intr(dev, node, &sc->sc_iinfo, intrs[i]);
428 if (rintr == PCI_INVALID_IRQ) {
429 device_printf(dev,
430 "<%s>: could not map EBus interrupt %d\n",
431 edi->edi_obdinfo.obd_name, intrs[i]);
429 free(reg, M_OFWPROP);
432 free(intrs, M_OFWPROP);
430 goto fail;
431 }
432 resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i,
433 rintr, rintr, 1);
434 }
435 free(intrs, M_OFWPROP);
436
437 return (edi);

--- 27 unchanged lines hidden ---
433 goto fail;
434 }
435 resource_list_add(&edi->edi_rl, SYS_RES_IRQ, i,
436 rintr, rintr, 1);
437 }
438 free(intrs, M_OFWPROP);
439
440 return (edi);

--- 27 unchanged lines hidden ---