Deleted Added
full compact
central.c (200874) central.c (225931)
1/*-
2 * Copyright (c) 2003 Jake Burkholder.
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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003 Jake Burkholder.
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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/sparc64/central/central.c 200874 2009-12-22 21:02:46Z marius $");
28__FBSDID("$FreeBSD: head/sys/sparc64/central/central.c 225931 2011-10-02 23:22:38Z marius $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/malloc.h>
35#include <sys/module.h>
36

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

55 struct sbus_ranges *sc_ranges;
56};
57
58static device_probe_t central_probe;
59static device_attach_t central_attach;
60static bus_print_child_t central_print_child;
61static bus_probe_nomatch_t central_probe_nomatch;
62static bus_alloc_resource_t central_alloc_resource;
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/malloc.h>
35#include <sys/module.h>
36

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

55 struct sbus_ranges *sc_ranges;
56};
57
58static device_probe_t central_probe;
59static device_attach_t central_attach;
60static bus_print_child_t central_print_child;
61static bus_probe_nomatch_t central_probe_nomatch;
62static bus_alloc_resource_t central_alloc_resource;
63static bus_adjust_resource_t central_adjust_resource;
63static bus_get_resource_list_t central_get_resource_list;
64static ofw_bus_get_devinfo_t central_get_devinfo;
65
66static int central_print_res(struct central_devinfo *);
67
68static device_method_t central_methods[] = {
69 /* Device interface */
70 DEVMETHOD(device_probe, central_probe),
71 DEVMETHOD(device_attach, central_attach),
72 DEVMETHOD(device_shutdown, bus_generic_shutdown),
73 DEVMETHOD(device_suspend, bus_generic_suspend),
74 DEVMETHOD(device_resume, bus_generic_resume),
75
76 /* Bus interface */
77 DEVMETHOD(bus_print_child, central_print_child),
78 DEVMETHOD(bus_probe_nomatch, central_probe_nomatch),
79 DEVMETHOD(bus_alloc_resource, central_alloc_resource),
80 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
81 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
64static bus_get_resource_list_t central_get_resource_list;
65static ofw_bus_get_devinfo_t central_get_devinfo;
66
67static int central_print_res(struct central_devinfo *);
68
69static device_method_t central_methods[] = {
70 /* Device interface */
71 DEVMETHOD(device_probe, central_probe),
72 DEVMETHOD(device_attach, central_attach),
73 DEVMETHOD(device_shutdown, bus_generic_shutdown),
74 DEVMETHOD(device_suspend, bus_generic_suspend),
75 DEVMETHOD(device_resume, bus_generic_resume),
76
77 /* Bus interface */
78 DEVMETHOD(bus_print_child, central_print_child),
79 DEVMETHOD(bus_probe_nomatch, central_probe_nomatch),
80 DEVMETHOD(bus_alloc_resource, central_alloc_resource),
81 DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
82 DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
83 DEVMETHOD(bus_adjust_resource, central_adjust_resource),
82 DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
83 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
84 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
85 DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
86 DEVMETHOD(bus_get_resource_list, central_get_resource_list),
87 DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
88
89 /* ofw_bus interface */

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

175 }
176 device_set_ivars(cdev, cdi);
177 }
178
179 return (bus_generic_attach(dev));
180}
181
182static int
84 DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource),
85 DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
86 DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
87 DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
88 DEVMETHOD(bus_get_resource_list, central_get_resource_list),
89 DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
90
91 /* ofw_bus interface */

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

177 }
178 device_set_ivars(cdev, cdi);
179 }
180
181 return (bus_generic_attach(dev));
182}
183
184static int
185central_adjust_resource(device_t bus __unused, device_t child __unused,
186 int type __unused, struct resource *r __unused, u_long start __unused,
187 u_long end __unused)
188{
189
190 return (ENXIO);
191}
192
193static int
183central_print_child(device_t dev, device_t child)
184{
185 int rv;
186
187 rv = bus_print_child_header(dev, child);
188 rv += central_print_res(device_get_ivars(child));
189 rv += bus_print_child_footer(dev, child);
190 return (rv);

--- 98 unchanged lines hidden ---
194central_print_child(device_t dev, device_t child)
195{
196 int rv;
197
198 rv = bus_print_child_header(dev, child);
199 rv += central_print_res(device_get_ivars(child));
200 rv += bus_print_child_footer(dev, child);
201 return (rv);

--- 98 unchanged lines hidden ---