Deleted Added
full compact
apb.c (145610) apb.c (153057)
1/*-
2 * Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier
3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001, 2003 Thomas Moestl <tmm@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * from: FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.3 2000/12/13
1/*-
2 * Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier
3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001, 2003 Thomas Moestl <tmm@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * from: FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.3 2000/12/13
32 *
33 * $FreeBSD: head/sys/sparc64/pci/apb.c 145610 2005-04-28 03:33:46Z marcel $
34 */
35
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/sparc64/pci/apb.c 153057 2005-12-03 18:11:26Z marius $");
36
36/*
37 * Support for the Sun APB (Advanced PCI Bridge) PCI-PCI bridge.
38 * This bridge does not fully comply to the PCI bridge specification, and is
39 * therefore not supported by the generic driver.
40 * We can use some of the pcib methods anyway.
41 */
42
43#include "opt_ofw_pci.h"

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

64#include <sparc64/pci/ofw_pci.h>
65#include <sparc64/pci/ofw_pcib_subr.h>
66
67/*
68 * Bridge-specific data.
69 */
70struct apb_softc {
71 struct ofw_pcib_gen_softc sc_bsc;
37/*
38 * Support for the Sun APB (Advanced PCI Bridge) PCI-PCI bridge.
39 * This bridge does not fully comply to the PCI bridge specification, and is
40 * therefore not supported by the generic driver.
41 * We can use some of the pcib methods anyway.
42 */
43
44#include "opt_ofw_pci.h"

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

65#include <sparc64/pci/ofw_pci.h>
66#include <sparc64/pci/ofw_pcib_subr.h>
67
68/*
69 * Bridge-specific data.
70 */
71struct apb_softc {
72 struct ofw_pcib_gen_softc sc_bsc;
72 u_int8_t sc_iomap;
73 u_int8_t sc_memmap;
73 uint8_t sc_iomap;
74 uint8_t sc_memmap;
74};
75
76static device_probe_t apb_probe;
77static device_attach_t apb_attach;
78static bus_alloc_resource_t apb_alloc_resource;
79
80static device_method_t apb_methods[] = {
81 /* Device interface */

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

138 pci_get_device(dev) == 0x5000) { /* APB */
139 device_set_desc(dev, "APB PCI-PCI bridge");
140 return (0);
141 }
142 return (ENXIO);
143}
144
145static void
75};
76
77static device_probe_t apb_probe;
78static device_attach_t apb_attach;
79static bus_alloc_resource_t apb_alloc_resource;
80
81static device_method_t apb_methods[] = {
82 /* Device interface */

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

139 pci_get_device(dev) == 0x5000) { /* APB */
140 device_set_desc(dev, "APB PCI-PCI bridge");
141 return (0);
142 }
143 return (ENXIO);
144}
145
146static void
146apb_map_print(u_int8_t map, u_long scale)
147apb_map_print(uint8_t map, u_long scale)
147{
148 int i, first;
149
150 for (first = 1, i = 0; i < 8; i++) {
151 if ((map & (1 << i)) != 0) {
152 printf("%s0x%lx-0x%lx", first ? "" : ", ",
153 i * scale, (i + 1) * scale - 1);
154 first = 0;
155 }
156 }
157}
158
159static int
148{
149 int i, first;
150
151 for (first = 1, i = 0; i < 8; i++) {
152 if ((map & (1 << i)) != 0) {
153 printf("%s0x%lx-0x%lx", first ? "" : ", ",
154 i * scale, (i + 1) * scale - 1);
155 first = 0;
156 }
157 }
158}
159
160static int
160apb_checkrange(u_int8_t map, u_long scale, u_long start, u_long end)
161apb_checkrange(uint8_t map, u_long scale, u_long start, u_long end)
161{
162 int i, ei;
163
164 i = start / scale;
165 ei = end / scale;
166 if (i > 7 || ei > 7)
167 return (0);
168 for (; i <= ei; i++)

--- 106 unchanged lines hidden ---
162{
163 int i, ei;
164
165 i = start / scale;
166 ei = end / scale;
167 if (i > 7 || ei > 7)
168 return (0);
169 for (; i <= ei; i++)

--- 106 unchanged lines hidden ---