Fri Jan 27 18:53:10 2012 UTC ()
converting extent(9) from malloc(9) to kmem(9)
preceding kmem-vmem-pool-uvm patch

releng@ acknowledged


(para)
diff -r1.25 -r1.26 src/sys/arch/algor/dev/mainbus.c
diff -r1.25 -r1.26 src/sys/arch/alpha/common/sgmap_common.c
diff -r1.19 -r1.20 src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c
diff -r1.23 -r1.24 src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c
diff -r1.39 -r1.40 src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c
diff -r1.44 -r1.45 src/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c
diff -r1.11 -r1.12 src/sys/arch/arc/arc/bus_space.c
diff -r1.6 -r1.7 src/sys/arch/arc/arc/wired_map_machdep.c
diff -r1.15 -r1.16 src/sys/arch/arc/jazz/jazzdmatlb.c
diff -r1.37 -r1.38 src/sys/arch/arc/pci/necpb.c
diff -r1.10 -r1.11 src/sys/arch/arm/gemini/gemini_pci.c
diff -r1.10 -r1.11 src/sys/arch/arm/ixp12x0/ixp12x0_pci.c
diff -r1.16 -r1.17 src/sys/arch/arm/s3c2xx0/s3c2800_pci.c
diff -r1.10 -r1.11 src/sys/arch/arm/xscale/becc_pci.c
diff -r1.10 -r1.11 src/sys/arch/arm/xscale/i80312_pci.c
diff -r1.10 -r1.11 src/sys/arch/arm/xscale/i80321_pci.c
diff -r1.7 -r1.8 src/sys/arch/arm/xscale/ixp425_pci.c
diff -r1.96 -r1.97 src/sys/arch/atari/atari/atari_init.c
diff -r1.56 -r1.57 src/sys/arch/atari/atari/bus.c
diff -r1.28 -r1.29 src/sys/arch/bebox/bebox/mainbus.c
diff -r1.27 -r1.28 src/sys/arch/cobalt/dev/gt.c
diff -r1.19 -r1.20 src/sys/arch/dreamcast/dev/g2/gapspci_dma.c
diff -r1.5 -r1.6 src/sys/arch/emips/emips/machdep.c
diff -r1.24 -r1.25 src/sys/arch/evbarm/ifpga/ifpga.c
diff -r1.8 -r1.9 src/sys/arch/evbarm/tsarm/isa/isa_io.c
diff -r1.3 -r1.4 src/sys/arch/evbmips/gdium/mainbus.c
diff -r1.9 -r1.10 src/sys/arch/evbmips/rmixl/machdep.c
diff -r1.21 -r1.22 src/sys/arch/evbppc/mpc85xx/machdep.c
diff -r1.4 -r1.5 src/sys/arch/ews4800mips/ews4800mips/bus_space.c
diff -r1.98 -r1.99 src/sys/arch/hp300/hp300/autoconf.c
diff -r1.13 -r1.14 src/sys/arch/hp700/dev/astro.c
diff -r1.32 -r1.33 src/sys/arch/hp700/dev/dino.c
diff -r1.11 -r1.12 src/sys/arch/hp700/dev/elroy.c
diff -r1.104 -r1.105 src/sys/arch/hp700/hp700/machdep.c
diff -r1.30 -r1.31 src/sys/arch/hpcmips/hpcmips/bus_space.c
diff -r1.40 -r1.41 src/sys/arch/hpcmips/tx/tx3912video.c
diff -r1.18 -r1.19 src/sys/arch/hpcsh/hpcsh/bus_space.c
diff -r1.10 -r1.11 src/sys/arch/ibmnws/ibmnws/mainbus.c
diff -r1.342 -r1.343 src/sys/arch/mac68k/mac68k/machdep.c
diff -r1.13 -r1.14 src/sys/arch/mips/alchemy/au_himem_space.c
diff -r1.8 -r1.9 src/sys/arch/mips/alchemy/au_wired_space.c
diff -r1.12 -r1.13 src/sys/arch/mips/alchemy/dev/aupci.c
diff -r1.18 -r1.19 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c
diff -r1.8 -r1.9 src/sys/arch/mips/rmi/rmixl_pcie.c
diff -r1.11 -r1.12 src/sys/arch/mipsco/mipsco/bus_space.c
diff -r1.14 -r1.15 src/sys/arch/mvmeppc/mvmeppc/mainbus.c
diff -r1.10 -r1.11 src/sys/arch/ofppc/pci/ofwpci.c
diff -r1.11 -r1.12 src/sys/arch/powerpc/booke/pci/pq3pci.c
diff -r1.10 -r1.11 src/sys/arch/powerpc/ibm4xx/pci/pchb.c
diff -r1.29 -r1.30 src/sys/arch/powerpc/powerpc/bus_space.c
diff -r1.32 -r1.33 src/sys/arch/prep/prep/mainbus.c
diff -r1.27 -r1.28 src/sys/arch/sandpoint/sandpoint/mainbus.c
diff -r1.9 -r1.10 src/sys/arch/sgimips/gio/pci_gio.c
diff -r1.13 -r1.14 src/sys/arch/sgimips/mace/pci_mace.c
diff -r1.16 -r1.17 src/sys/arch/sh3/dev/shpcic.c
diff -r1.65 -r1.66 src/sys/arch/sparc/dev/vme_machdep.c
diff -r1.94 -r1.95 src/sys/arch/sparc/sparc/iommu.c
diff -r1.314 -r1.315 src/sys/arch/sparc/sparc/machdep.c
diff -r1.105 -r1.106 src/sys/arch/sparc64/dev/iommu.c
diff -r1.111 -r1.112 src/sys/arch/sparc64/dev/psycho.c
diff -r1.263 -r1.264 src/sys/arch/sparc64/sparc64/machdep.c
diff -r1.71 -r1.72 src/sys/arch/sun2/sun2/machdep.c
diff -r1.36 -r1.37 src/sys/arch/sun3/sun3/dvma.c
diff -r1.40 -r1.41 src/sys/arch/sun3/sun3x/dvma.c
diff -r1.184 -r1.185 src/sys/arch/vax/vax/machdep.c
diff -r1.16 -r1.17 src/sys/arch/vax/vax/sgmap.c
diff -r1.42 -r1.43 src/sys/arch/x68k/dev/intio.c
diff -r1.8 -r1.9 src/sys/arch/x86/pci/pci_addr_fixup.c
diff -r1.37 -r1.38 src/sys/arch/x86/x86/bus_space.c
diff -r1.28 -r1.29 src/sys/dev/cardbus/rbus.c
diff -r1.18 -r1.19 src/sys/dev/ic/cpc700.c
diff -r1.28 -r1.29 src/sys/dev/marvell/gtpci.c
diff -r1.5 -r1.6 src/sys/dev/marvell/mvpex.c
diff -r1.26 -r1.27 src/sys/dev/pci/btvmei.c
diff -r1.33 -r1.34 src/sys/dev/pci/pciconf.c
diff -r1.50 -r1.51 src/sys/dev/usb/usb_mem.c
diff -r1.24 -r1.25 src/sys/dev/vme/vme.c
diff -r1.72 -r1.73 src/sys/kern/subr_extent.c
diff -r1.18 -r1.19 src/sys/sys/extent.h
diff -r1.3 -r1.4 src/tests/kernel/t_extent.c

cvs diff -r1.25 -r1.26 src/sys/arch/algor/dev/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/algor/dev/mainbus.c 2011/07/09 16:03:01 1.25
+++ src/sys/arch/algor/dev/mainbus.c 2012/01/27 18:52:47 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.25 2011/07/09 16:03:01 matt Exp $ */ 1/* $NetBSD: mainbus.c,v 1.26 2012/01/27 18:52:47 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.25 2011/07/09 16:03:01 matt Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.26 2012/01/27 18:52:47 para Exp $");
34 34
35#include "opt_algor_p4032.h" 35#include "opt_algor_p4032.h"
36#include "opt_algor_p5064.h" 36#include "opt_algor_p5064.h"
37#include "opt_algor_p6032.h" 37#include "opt_algor_p6032.h"
38 38
39#include "opt_pci.h" 39#include "opt_pci.h"
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/bus.h> 42#include <sys/bus.h>
43#include <sys/conf.h> 43#include <sys/conf.h>
44#include <sys/device.h> 44#include <sys/device.h>
45#include <sys/extent.h> 45#include <sys/extent.h>
46#include <sys/malloc.h> 46#include <sys/malloc.h>
@@ -149,54 +149,54 @@ mainbus_attach(device_t parent, device_t @@ -149,54 +149,54 @@ mainbus_attach(device_t parent, device_t
149#endif 149#endif
150#endif 150#endif
151 151
152 mainbus_found = 1; 152 mainbus_found = 1;
153 153
154 printf("\n"); 154 printf("\n");
155 155
156#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE) 156#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE)
157#if defined(ALGOR_P4032) 157#if defined(ALGOR_P4032)
158 /* 158 /*
159 * Reserve the bottom 64K of the I/O space for ISA devices. 159 * Reserve the bottom 64K of the I/O space for ISA devices.
160 */ 160 */
161 ioext = extent_create("pciio", 0x00010000, 0x000effff, 161 ioext = extent_create("pciio", 0x00010000, 0x000effff,
162 M_DEVBUF, NULL, 0, EX_NOWAIT); 162 NULL, 0, EX_NOWAIT);
163 memext = extent_create("pcimem", 0x01000000, 0x07ffffff, 163 memext = extent_create("pcimem", 0x01000000, 0x07ffffff,
164 M_DEVBUF, NULL, 0, EX_NOWAIT); 164 NULL, 0, EX_NOWAIT);
165 165
166 pc = &p4032_configuration.ac_pc; 166 pc = &p4032_configuration.ac_pc;
167#elif defined(ALGOR_P5064) 167#elif defined(ALGOR_P5064)
168 /* 168 /*
169 * Reserve the bottom 512K of the I/O space for ISA devices. 169 * Reserve the bottom 512K of the I/O space for ISA devices.
170 * According to the PMON sources, this is a work-around for 170 * According to the PMON sources, this is a work-around for
171 * a bug in the ISA bridge. 171 * a bug in the ISA bridge.
172 */ 172 */
173 ioext = extent_create("pciio", 0x00080000, 0x00ffffff, 173 ioext = extent_create("pciio", 0x00080000, 0x00ffffff,
174 M_DEVBUF, NULL, 0, EX_NOWAIT); 174 NULL, 0, EX_NOWAIT);
175 memext = extent_create("pcimem", 0x01000000, 0x07ffffff, 175 memext = extent_create("pcimem", 0x01000000, 0x07ffffff,
176 M_DEVBUF, NULL, 0, EX_NOWAIT); 176 NULL, 0, EX_NOWAIT);
177 177
178 pc = &p5064_configuration.ac_pc; 178 pc = &p5064_configuration.ac_pc;
179#if defined(PCI_NETBSD_ENABLE_IDE) 179#if defined(PCI_NETBSD_ENABLE_IDE)
180 idetag = pci_make_tag(pc, 0, 2, 1); 180 idetag = pci_make_tag(pc, 0, 2, 1);
181#endif 181#endif
182#elif defined(ALGOR_P6032) 182#elif defined(ALGOR_P6032)
183 /* 183 /*
184 * Reserve the bottom 64K of the I/O space for ISA devices. 184 * Reserve the bottom 64K of the I/O space for ISA devices.
185 */ 185 */
186 ioext = extent_create("pciio", 0x00010000, 0x000effff, 186 ioext = extent_create("pciio", 0x00010000, 0x000effff,
187 M_DEVBUF, NULL, 0, EX_NOWAIT); 187 NULL, 0, EX_NOWAIT);
188 memext = extent_create("pcimem", 0x01000000, 0x0affffff, 188 memext = extent_create("pcimem", 0x01000000, 0x0affffff,
189 M_DEVBUF, NULL, 0, EX_NOWAIT); 189 NULL, 0, EX_NOWAIT);
190 190
191 pc = &p6032_configuration.ac_pc; 191 pc = &p6032_configuration.ac_pc;
192#if defined(PCI_NETBSD_ENABLE_IDE) 192#if defined(PCI_NETBSD_ENABLE_IDE)
193 idetag = pci_make_tag(pc, 0, 17, 1); 193 idetag = pci_make_tag(pc, 0, 17, 1);
194#endif 194#endif
195#endif /* ALGOR_P4032 || ALGOR_P5064 || ALGOR_P6032 */ 195#endif /* ALGOR_P4032 || ALGOR_P5064 || ALGOR_P6032 */
196 196
197 pci_configure_bus(pc, ioext, memext, NULL, 0, mips_cache_info.mci_dcache_align); 197 pci_configure_bus(pc, ioext, memext, NULL, 0, mips_cache_info.mci_dcache_align);
198 extent_destroy(ioext); 198 extent_destroy(ioext);
199 extent_destroy(memext); 199 extent_destroy(memext);
200 200
201#if defined(PCI_NETBSD_ENABLE_IDE) 201#if defined(PCI_NETBSD_ENABLE_IDE)
202 /* 202 /*

cvs diff -r1.25 -r1.26 src/sys/arch/alpha/common/sgmap_common.c (expand / switch to unified diff)

--- src/sys/arch/alpha/common/sgmap_common.c 2011/07/01 19:22:35 1.25
+++ src/sys/arch/alpha/common/sgmap_common.c 2012/01/27 18:52:48 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sgmap_common.c,v 1.25 2011/07/01 19:22:35 dyoung Exp $ */ 1/* $NetBSD: sgmap_common.c,v 1.26 2012/01/27 18:52:48 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ 33#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
34 34
35__KERNEL_RCSID(0, "$NetBSD: sgmap_common.c,v 1.25 2011/07/01 19:22:35 dyoung Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: sgmap_common.c,v 1.26 2012/01/27 18:52:48 para Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/proc.h> 41#include <sys/proc.h>
42 42
43#include <uvm/uvm_extern.h> 43#include <uvm/uvm_extern.h>
44 44
45#define _ALPHA_BUS_DMA_PRIVATE 45#define _ALPHA_BUS_DMA_PRIVATE
46#include <sys/bus.h> 46#include <sys/bus.h>
47 47
48#include <alpha/common/sgmapvar.h> 48#include <alpha/common/sgmapvar.h>
@@ -97,27 +97,27 @@ alpha_sgmap_init(bus_dma_tag_t t, struct @@ -97,27 +97,27 @@ alpha_sgmap_init(bus_dma_tag_t t, struct
97 panic("unable to allocate page table for sgmap `%s'", 97 panic("unable to allocate page table for sgmap `%s'",
98 name); 98 name);
99 goto die; 99 goto die;
100 } 100 }
101 sgmap->aps_ptpa = seg.ds_addr; 101 sgmap->aps_ptpa = seg.ds_addr;
102 sgmap->aps_pt = (void *)ALPHA_PHYS_TO_K0SEG(sgmap->aps_ptpa); 102 sgmap->aps_pt = (void *)ALPHA_PHYS_TO_K0SEG(sgmap->aps_ptpa);
103 } 103 }
104 104
105 /* 105 /*
106 * Create the extent map used to manage the virtual address 106 * Create the extent map used to manage the virtual address
107 * space. 107 * space.
108 */ 108 */
109 sgmap->aps_ex = extent_create(name, sgvabase, sgvasize - 1, 109 sgmap->aps_ex = extent_create(name, sgvabase, sgvasize - 1,
110 M_DMAMAP, NULL, 0, EX_NOWAIT|EX_NOCOALESCE); 110 NULL, 0, EX_NOWAIT|EX_NOCOALESCE);
111 if (sgmap->aps_ex == NULL) { 111 if (sgmap->aps_ex == NULL) {
112 printf("unable to create extent map for sgmap `%s'\n", 112 printf("unable to create extent map for sgmap `%s'\n",
113 name); 113 name);
114 goto die; 114 goto die;
115 } 115 }
116 116
117 /* 117 /*
118 * Allocate a spill page if that hasn't already been done. 118 * Allocate a spill page if that hasn't already been done.
119 */ 119 */
120 if (alpha_sgmap_prefetch_spill_page_va == 0) { 120 if (alpha_sgmap_prefetch_spill_page_va == 0) {
121 if (bus_dmamem_alloc(t, PAGE_SIZE, 0, 0, &seg, 1, &rseg, 121 if (bus_dmamem_alloc(t, PAGE_SIZE, 0, 0, &seg, 1, &rseg,
122 BUS_DMA_NOWAIT)) { 122 BUS_DMA_NOWAIT)) {
123 printf("unable to allocate spill page for sgmap `%s'\n", 123 printf("unable to allocate spill page for sgmap `%s'\n",

cvs diff -r1.19 -r1.20 src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c (expand / switch to unified diff)

--- src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c 2011/09/25 13:36:53 1.19
+++ src/sys/arch/alpha/pci/pci_bwx_bus_io_chipdep.c 2012/01/27 18:52:49 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_bwx_bus_io_chipdep.c,v 1.19 2011/09/25 13:36:53 chs Exp $ */ 1/* $NetBSD: pci_bwx_bus_io_chipdep.c,v 1.20 2012/01/27 18:52:49 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 * CHIP_IO_BASE I/O space base to use. 66 * CHIP_IO_BASE I/O space base to use.
67 * CHIP_IO_EX_STORE 67 * CHIP_IO_EX_STORE
68 * If defined, device-provided static storage area 68 * If defined, device-provided static storage area
69 * for the I/O space extent. If this is defined, 69 * for the I/O space extent. If this is defined,
70 * CHIP_IO_EX_STORE_SIZE must also be defined. If 70 * CHIP_IO_EX_STORE_SIZE must also be defined. If
71 * this is not defined, a static area will be 71 * this is not defined, a static area will be
72 * declared. 72 * declared.
73 * CHIP_IO_EX_STORE_SIZE 73 * CHIP_IO_EX_STORE_SIZE
74 * Size of the device-provided static storage area 74 * Size of the device-provided static storage area
75 * for the I/O memory space extent. 75 * for the I/O memory space extent.
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_io_chipdep.c,v 1.19 2011/09/25 13:36:53 chs Exp $"); 79__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_io_chipdep.c,v 1.20 2012/01/27 18:52:49 para Exp $");
80 80
81#include <sys/extent.h> 81#include <sys/extent.h>
82 82
83#include <machine/bwx.h> 83#include <machine/bwx.h>
84 84
85#define __C(A,B) __CONCAT(A,B) 85#define __C(A,B) __CONCAT(A,B)
86#define __S(S) __STRING(S) 86#define __S(S) __STRING(S)
87 87
88/* mapping/unmapping */ 88/* mapping/unmapping */
89int __C(CHIP,_io_map)(void *, bus_addr_t, bus_size_t, int, 89int __C(CHIP,_io_map)(void *, bus_addr_t, bus_size_t, int,
90 bus_space_handle_t *, int); 90 bus_space_handle_t *, int);
91void __C(CHIP,_io_unmap)(void *, bus_space_handle_t, 91void __C(CHIP,_io_unmap)(void *, bus_space_handle_t,
92 bus_size_t, int); 92 bus_size_t, int);
@@ -292,27 +292,27 @@ __C(CHIP,_bus_io_init)(t, v) @@ -292,27 +292,27 @@ __C(CHIP,_bus_io_init)(t, v)
292 /* set region */ 292 /* set region */
293 t->abs_sr_1 = __C(CHIP,_io_set_region_1); 293 t->abs_sr_1 = __C(CHIP,_io_set_region_1);
294 t->abs_sr_2 = __C(CHIP,_io_set_region_2); 294 t->abs_sr_2 = __C(CHIP,_io_set_region_2);
295 t->abs_sr_4 = __C(CHIP,_io_set_region_4); 295 t->abs_sr_4 = __C(CHIP,_io_set_region_4);
296 t->abs_sr_8 = __C(CHIP,_io_set_region_8); 296 t->abs_sr_8 = __C(CHIP,_io_set_region_8);
297 297
298 /* copy */ 298 /* copy */
299 t->abs_c_1 = __C(CHIP,_io_copy_region_1); 299 t->abs_c_1 = __C(CHIP,_io_copy_region_1);
300 t->abs_c_2 = __C(CHIP,_io_copy_region_2); 300 t->abs_c_2 = __C(CHIP,_io_copy_region_2);
301 t->abs_c_4 = __C(CHIP,_io_copy_region_4); 301 t->abs_c_4 = __C(CHIP,_io_copy_region_4);
302 t->abs_c_8 = __C(CHIP,_io_copy_region_8); 302 t->abs_c_8 = __C(CHIP,_io_copy_region_8);
303 303
304 ex = extent_create(__S(__C(CHIP,_bus_io)), 0x0UL, 0xffffffffUL, 304 ex = extent_create(__S(__C(CHIP,_bus_io)), 0x0UL, 0xffffffffUL,
305 M_DEVBUF, (void *)CHIP_IO_EX_STORE(v), CHIP_IO_EX_STORE_SIZE(v), 305 (void *)CHIP_IO_EX_STORE(v), CHIP_IO_EX_STORE_SIZE(v),
306 EX_NOWAIT|EX_NOCOALESCE); 306 EX_NOWAIT|EX_NOCOALESCE);
307 307
308 CHIP_IO_EXTENT(v) = ex; 308 CHIP_IO_EXTENT(v) = ex;
309} 309}
310 310
311int 311int
312__C(CHIP,_io_translate)(v, ioaddr, iolen, flags, abst) 312__C(CHIP,_io_translate)(v, ioaddr, iolen, flags, abst)
313 void *v; 313 void *v;
314 bus_addr_t ioaddr;  314 bus_addr_t ioaddr;
315 bus_size_t iolen; 315 bus_size_t iolen;
316 int flags; 316 int flags;
317 struct alpha_bus_space_translation *abst; 317 struct alpha_bus_space_translation *abst;
318{ 318{

cvs diff -r1.23 -r1.24 src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c (expand / switch to unified diff)

--- src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c 2011/09/25 13:36:53 1.23
+++ src/sys/arch/alpha/pci/pci_bwx_bus_mem_chipdep.c 2012/01/27 18:52:49 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.23 2011/09/25 13:36:53 chs Exp $ */ 1/* $NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.24 2012/01/27 18:52:49 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 * CHIP_MEM_BASE Mem space base to use. 66 * CHIP_MEM_BASE Mem space base to use.
67 * CHIP_MEM_EX_STORE 67 * CHIP_MEM_EX_STORE
68 * If defined, device-provided static storage area 68 * If defined, device-provided static storage area
69 * for the memory space extent. If this is 69 * for the memory space extent. If this is
70 * defined, CHIP_MEM_EX_STORE_SIZE must also be 70 * defined, CHIP_MEM_EX_STORE_SIZE must also be
71 * defined. If this is not defined, a static area 71 * defined. If this is not defined, a static area
72 * will be declared. 72 * will be declared.
73 * CHIP_MEM_EX_STORE_SIZE 73 * CHIP_MEM_EX_STORE_SIZE
74 * Size of the device-provided static storage area 74 * Size of the device-provided static storage area
75 * for the memory space extent. 75 * for the memory space extent.
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.23 2011/09/25 13:36:53 chs Exp $"); 79__KERNEL_RCSID(1, "$NetBSD: pci_bwx_bus_mem_chipdep.c,v 1.24 2012/01/27 18:52:49 para Exp $");
80 80
81#include <sys/extent.h> 81#include <sys/extent.h>
82 82
83#include <machine/bwx.h> 83#include <machine/bwx.h>
84 84
85#define __C(A,B) __CONCAT(A,B) 85#define __C(A,B) __CONCAT(A,B)
86#define __S(S) __STRING(S) 86#define __S(S) __STRING(S)
87 87
88/* mapping/unmapping */ 88/* mapping/unmapping */
89int __C(CHIP,_mem_map)(void *, bus_addr_t, bus_size_t, int, 89int __C(CHIP,_mem_map)(void *, bus_addr_t, bus_size_t, int,
90 bus_space_handle_t *, int); 90 bus_space_handle_t *, int);
91void __C(CHIP,_mem_unmap)(void *, bus_space_handle_t, 91void __C(CHIP,_mem_unmap)(void *, bus_space_handle_t,
92 bus_size_t, int); 92 bus_size_t, int);
@@ -292,27 +292,27 @@ __C(CHIP,_bus_mem_init)(t, v) @@ -292,27 +292,27 @@ __C(CHIP,_bus_mem_init)(t, v)
292 /* set region */ 292 /* set region */
293 t->abs_sr_1 = __C(CHIP,_mem_set_region_1); 293 t->abs_sr_1 = __C(CHIP,_mem_set_region_1);
294 t->abs_sr_2 = __C(CHIP,_mem_set_region_2); 294 t->abs_sr_2 = __C(CHIP,_mem_set_region_2);
295 t->abs_sr_4 = __C(CHIP,_mem_set_region_4); 295 t->abs_sr_4 = __C(CHIP,_mem_set_region_4);
296 t->abs_sr_8 = __C(CHIP,_mem_set_region_8); 296 t->abs_sr_8 = __C(CHIP,_mem_set_region_8);
297 297
298 /* copy */ 298 /* copy */
299 t->abs_c_1 = __C(CHIP,_mem_copy_region_1); 299 t->abs_c_1 = __C(CHIP,_mem_copy_region_1);
300 t->abs_c_2 = __C(CHIP,_mem_copy_region_2); 300 t->abs_c_2 = __C(CHIP,_mem_copy_region_2);
301 t->abs_c_4 = __C(CHIP,_mem_copy_region_4); 301 t->abs_c_4 = __C(CHIP,_mem_copy_region_4);
302 t->abs_c_8 = __C(CHIP,_mem_copy_region_8); 302 t->abs_c_8 = __C(CHIP,_mem_copy_region_8);
303 303
304 ex = extent_create(__S(__C(CHIP,_bus_mem)), 0x0UL, 0xffffffffUL, 304 ex = extent_create(__S(__C(CHIP,_bus_mem)), 0x0UL, 0xffffffffUL,
305 M_DEVBUF, (void *)CHIP_MEM_EX_STORE(v), CHIP_MEM_EX_STORE_SIZE(v), 305 (void *)CHIP_MEM_EX_STORE(v), CHIP_MEM_EX_STORE_SIZE(v),
306 EX_NOWAIT|EX_NOCOALESCE); 306 EX_NOWAIT|EX_NOCOALESCE);
307 307
308 CHIP_MEM_EXTENT(v) = ex; 308 CHIP_MEM_EXTENT(v) = ex;
309} 309}
310 310
311int 311int
312__C(CHIP,_mem_translate)(v, memaddr, memlen, flags, abst) 312__C(CHIP,_mem_translate)(v, memaddr, memlen, flags, abst)
313 void *v; 313 void *v;
314 bus_addr_t memaddr; 314 bus_addr_t memaddr;
315 bus_size_t memlen; 315 bus_size_t memlen;
316 int flags; 316 int flags;
317 struct alpha_bus_space_translation *abst; 317 struct alpha_bus_space_translation *abst;
318{ 318{

cvs diff -r1.39 -r1.40 src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c (expand / switch to unified diff)

--- src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c 2011/09/25 13:36:53 1.39
+++ src/sys/arch/alpha/pci/pci_swiz_bus_io_chipdep.c 2012/01/27 18:52:49 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_swiz_bus_io_chipdep.c,v 1.39 2011/09/25 13:36:53 chs Exp $ */ 1/* $NetBSD: pci_swiz_bus_io_chipdep.c,v 1.40 2012/01/27 18:52:49 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 * CHIP_IO_BASE Sparse I/O space base to use. 66 * CHIP_IO_BASE Sparse I/O space base to use.
67 * CHIP_IO_EX_STORE 67 * CHIP_IO_EX_STORE
68 * If defined, device-provided static storage area 68 * If defined, device-provided static storage area
69 * for the I/O space extent. If this is defined, 69 * for the I/O space extent. If this is defined,
70 * CHIP_IO_EX_STORE_SIZE must also be defined. If 70 * CHIP_IO_EX_STORE_SIZE must also be defined. If
71 * this is not defined, a static area will be 71 * this is not defined, a static area will be
72 * declared. 72 * declared.
73 * CHIP_IO_EX_STORE_SIZE 73 * CHIP_IO_EX_STORE_SIZE
74 * Size of the device-provided static storage area 74 * Size of the device-provided static storage area
75 * for the I/O memory space extent. 75 * for the I/O memory space extent.
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(1, "$NetBSD: pci_swiz_bus_io_chipdep.c,v 1.39 2011/09/25 13:36:53 chs Exp $"); 79__KERNEL_RCSID(1, "$NetBSD: pci_swiz_bus_io_chipdep.c,v 1.40 2012/01/27 18:52:49 para Exp $");
80 80
81#include <sys/extent.h> 81#include <sys/extent.h>
82 82
83#define __C(A,B) __CONCAT(A,B) 83#define __C(A,B) __CONCAT(A,B)
84#define __S(S) __STRING(S) 84#define __S(S) __STRING(S)
85 85
86/* mapping/unmapping */ 86/* mapping/unmapping */
87int __C(CHIP,_io_map)(void *, bus_addr_t, bus_size_t, int, 87int __C(CHIP,_io_map)(void *, bus_addr_t, bus_size_t, int,
88 bus_space_handle_t *, int); 88 bus_space_handle_t *, int);
89void __C(CHIP,_io_unmap)(void *, bus_space_handle_t, 89void __C(CHIP,_io_unmap)(void *, bus_space_handle_t,
90 bus_size_t, int); 90 bus_size_t, int);
91int __C(CHIP,_io_subregion)(void *, bus_space_handle_t, 91int __C(CHIP,_io_subregion)(void *, bus_space_handle_t,
92 bus_size_t, bus_size_t, bus_space_handle_t *); 92 bus_size_t, bus_size_t, bus_space_handle_t *);
@@ -297,27 +297,27 @@ __C(CHIP,_bus_io_init)(bus_space_tag_t t @@ -297,27 +297,27 @@ __C(CHIP,_bus_io_init)(bus_space_tag_t t
297 t->abs_sr_1 = __C(CHIP,_io_set_region_1); 297 t->abs_sr_1 = __C(CHIP,_io_set_region_1);
298 t->abs_sr_2 = __C(CHIP,_io_set_region_2); 298 t->abs_sr_2 = __C(CHIP,_io_set_region_2);
299 t->abs_sr_4 = __C(CHIP,_io_set_region_4); 299 t->abs_sr_4 = __C(CHIP,_io_set_region_4);
300 t->abs_sr_8 = __C(CHIP,_io_set_region_8); 300 t->abs_sr_8 = __C(CHIP,_io_set_region_8);
301 301
302 /* copy */ 302 /* copy */
303 t->abs_c_1 = __C(CHIP,_io_copy_region_1); 303 t->abs_c_1 = __C(CHIP,_io_copy_region_1);
304 t->abs_c_2 = __C(CHIP,_io_copy_region_2); 304 t->abs_c_2 = __C(CHIP,_io_copy_region_2);
305 t->abs_c_4 = __C(CHIP,_io_copy_region_4); 305 t->abs_c_4 = __C(CHIP,_io_copy_region_4);
306 t->abs_c_8 = __C(CHIP,_io_copy_region_8); 306 t->abs_c_8 = __C(CHIP,_io_copy_region_8);
307 307
308 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */ 308 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */
309 ex = extent_create(__S(__C(CHIP,_bus_io)), 0x0UL, 0xffffffffUL, 309 ex = extent_create(__S(__C(CHIP,_bus_io)), 0x0UL, 0xffffffffUL,
310 M_DEVBUF, (void *)CHIP_IO_EX_STORE(v), CHIP_IO_EX_STORE_SIZE(v), 310 (void *)CHIP_IO_EX_STORE(v), CHIP_IO_EX_STORE_SIZE(v),
311 EX_NOWAIT); 311 EX_NOWAIT);
312 extent_alloc_region(ex, 0, 0xffffffffUL, EX_NOWAIT); 312 extent_alloc_region(ex, 0, 0xffffffffUL, EX_NOWAIT);
313 313
314#ifdef CHIP_IO_W1_BUS_START 314#ifdef CHIP_IO_W1_BUS_START
315#ifdef EXTENT_DEBUG 315#ifdef EXTENT_DEBUG
316 printf("io: freeing from 0x%lx to 0x%lx\n", CHIP_IO_W1_BUS_START(v), 316 printf("io: freeing from 0x%lx to 0x%lx\n", CHIP_IO_W1_BUS_START(v),
317 CHIP_IO_W1_BUS_END(v)); 317 CHIP_IO_W1_BUS_END(v));
318#endif 318#endif
319 extent_free(ex, CHIP_IO_W1_BUS_START(v), 319 extent_free(ex, CHIP_IO_W1_BUS_START(v),
320 CHIP_IO_W1_BUS_END(v) - CHIP_IO_W1_BUS_START(v) + 1, EX_NOWAIT); 320 CHIP_IO_W1_BUS_END(v) - CHIP_IO_W1_BUS_START(v) + 1, EX_NOWAIT);
321#endif 321#endif
322#ifdef CHIP_IO_W2_BUS_START 322#ifdef CHIP_IO_W2_BUS_START
323#ifdef EXTENT_DEBUG 323#ifdef EXTENT_DEBUG

cvs diff -r1.44 -r1.45 src/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c (expand / switch to unified diff)

--- src/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c 2011/09/25 13:36:53 1.44
+++ src/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c 2012/01/27 18:52:49 1.45
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_swiz_bus_mem_chipdep.c,v 1.44 2011/09/25 13:36:53 chs Exp $ */ 1/* $NetBSD: pci_swiz_bus_mem_chipdep.c,v 1.45 2012/01/27 18:52:49 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -75,27 +75,27 @@ @@ -75,27 +75,27 @@
75 * CHIP_S_MEM_BASE Sparse Mem space base to use. 75 * CHIP_S_MEM_BASE Sparse Mem space base to use.
76 * CHIP_S_MEM_EX_STORE 76 * CHIP_S_MEM_EX_STORE
77 * If defined, device-provided static storage area 77 * If defined, device-provided static storage area
78 * for the sparse memory space extent. If this is 78 * for the sparse memory space extent. If this is
79 * defined, CHIP_S_MEM_EX_STORE_SIZE must also be 79 * defined, CHIP_S_MEM_EX_STORE_SIZE must also be
80 * defined. If this is not defined, a static area 80 * defined. If this is not defined, a static area
81 * will be declared. 81 * will be declared.
82 * CHIP_S_MEM_EX_STORE_SIZE 82 * CHIP_S_MEM_EX_STORE_SIZE
83 * Size of the device-provided static storage area 83 * Size of the device-provided static storage area
84 * for the sparse memory space extent. 84 * for the sparse memory space extent.
85 */ 85 */
86 86
87#include <sys/cdefs.h> 87#include <sys/cdefs.h>
88__KERNEL_RCSID(1, "$NetBSD: pci_swiz_bus_mem_chipdep.c,v 1.44 2011/09/25 13:36:53 chs Exp $"); 88__KERNEL_RCSID(1, "$NetBSD: pci_swiz_bus_mem_chipdep.c,v 1.45 2012/01/27 18:52:49 para Exp $");
89 89
90#include <sys/extent.h> 90#include <sys/extent.h>
91 91
92#define __C(A,B) __CONCAT(A,B) 92#define __C(A,B) __CONCAT(A,B)
93#define __S(S) __STRING(S) 93#define __S(S) __STRING(S)
94 94
95/* mapping/unmapping */ 95/* mapping/unmapping */
96int __C(CHIP,_mem_map)(void *, bus_addr_t, bus_size_t, int, 96int __C(CHIP,_mem_map)(void *, bus_addr_t, bus_size_t, int,
97 bus_space_handle_t *, int); 97 bus_space_handle_t *, int);
98void __C(CHIP,_mem_unmap)(void *, bus_space_handle_t, 98void __C(CHIP,_mem_unmap)(void *, bus_space_handle_t,
99 bus_size_t, int); 99 bus_size_t, int);
100int __C(CHIP,_mem_subregion)(void *, bus_space_handle_t, 100int __C(CHIP,_mem_subregion)(void *, bus_space_handle_t,
101 bus_size_t, bus_size_t, bus_space_handle_t *); 101 bus_size_t, bus_size_t, bus_space_handle_t *);
@@ -319,50 +319,50 @@ __C(CHIP,_bus_mem_init)(bus_space_tag_t  @@ -319,50 +319,50 @@ __C(CHIP,_bus_mem_init)(bus_space_tag_t
319 t->abs_sr_2 = __C(CHIP,_mem_set_region_2); 319 t->abs_sr_2 = __C(CHIP,_mem_set_region_2);
320 t->abs_sr_4 = __C(CHIP,_mem_set_region_4); 320 t->abs_sr_4 = __C(CHIP,_mem_set_region_4);
321 t->abs_sr_8 = __C(CHIP,_mem_set_region_8); 321 t->abs_sr_8 = __C(CHIP,_mem_set_region_8);
322 322
323 /* copy */ 323 /* copy */
324 t->abs_c_1 = __C(CHIP,_mem_copy_region_1); 324 t->abs_c_1 = __C(CHIP,_mem_copy_region_1);
325 t->abs_c_2 = __C(CHIP,_mem_copy_region_2); 325 t->abs_c_2 = __C(CHIP,_mem_copy_region_2);
326 t->abs_c_4 = __C(CHIP,_mem_copy_region_4); 326 t->abs_c_4 = __C(CHIP,_mem_copy_region_4);
327 t->abs_c_8 = __C(CHIP,_mem_copy_region_8); 327 t->abs_c_8 = __C(CHIP,_mem_copy_region_8);
328 328
329#ifdef CHIP_D_MEM_W1_SYS_START 329#ifdef CHIP_D_MEM_W1_SYS_START
330 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */ 330 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */
331 dex = extent_create(__S(__C(CHIP,_bus_dmem)), 0x0UL, 331 dex = extent_create(__S(__C(CHIP,_bus_dmem)), 0x0UL,
332 0xffffffffffffffffUL, M_DEVBUF, 332 0xffffffffffffffffUL,
333 (void *)CHIP_D_MEM_EX_STORE(v), CHIP_D_MEM_EX_STORE_SIZE(v), 333 (void *)CHIP_D_MEM_EX_STORE(v), CHIP_D_MEM_EX_STORE_SIZE(v),
334 EX_NOWAIT); 334 EX_NOWAIT);
335 extent_alloc_region(dex, 0, 0xffffffffffffffffUL, EX_NOWAIT); 335 extent_alloc_region(dex, 0, 0xffffffffffffffffUL, EX_NOWAIT);
336 336
337#ifdef CHIP_D_MEM_W1_BUS_START 337#ifdef CHIP_D_MEM_W1_BUS_START
338#ifdef EXTENT_DEBUG 338#ifdef EXTENT_DEBUG
339 printf("dmem: freeing from 0x%lx to 0x%lx\n", 339 printf("dmem: freeing from 0x%lx to 0x%lx\n",
340 CHIP_D_MEM_W1_BUS_START(v), CHIP_D_MEM_W1_BUS_END(v)); 340 CHIP_D_MEM_W1_BUS_START(v), CHIP_D_MEM_W1_BUS_END(v));
341#endif 341#endif
342 extent_free(dex, CHIP_D_MEM_W1_BUS_START(v), 342 extent_free(dex, CHIP_D_MEM_W1_BUS_START(v),
343 CHIP_D_MEM_W1_BUS_END(v) - CHIP_D_MEM_W1_BUS_START(v) + 1, 343 CHIP_D_MEM_W1_BUS_END(v) - CHIP_D_MEM_W1_BUS_START(v) + 1,
344 EX_NOWAIT); 344 EX_NOWAIT);
345#endif 345#endif
346 346
347#ifdef EXTENT_DEBUG 347#ifdef EXTENT_DEBUG
348 extent_print(dex); 348 extent_print(dex);
349#endif 349#endif
350 CHIP_D_MEM_EXTENT(v) = dex; 350 CHIP_D_MEM_EXTENT(v) = dex;
351#endif /* CHIP_D_MEM_W1_SYS_START */ 351#endif /* CHIP_D_MEM_W1_SYS_START */
352 352
353 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */ 353 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */
354 sex = extent_create(__S(__C(CHIP,_bus_smem)), 0x0UL, 354 sex = extent_create(__S(__C(CHIP,_bus_smem)), 0x0UL,
355 0xffffffffffffffffUL, M_DEVBUF, 355 0xffffffffffffffffUL,
356 (void *)CHIP_S_MEM_EX_STORE(v), CHIP_S_MEM_EX_STORE_SIZE(v), 356 (void *)CHIP_S_MEM_EX_STORE(v), CHIP_S_MEM_EX_STORE_SIZE(v),
357 EX_NOWAIT); 357 EX_NOWAIT);
358 extent_alloc_region(sex, 0, 0xffffffffffffffffUL, EX_NOWAIT); 358 extent_alloc_region(sex, 0, 0xffffffffffffffffUL, EX_NOWAIT);
359 359
360#ifdef CHIP_S_MEM_W1_BUS_START 360#ifdef CHIP_S_MEM_W1_BUS_START
361#ifdef EXTENT_DEBUG 361#ifdef EXTENT_DEBUG
362 printf("smem: freeing from 0x%lx to 0x%lx\n", 362 printf("smem: freeing from 0x%lx to 0x%lx\n",
363 CHIP_S_MEM_W1_BUS_START(v), CHIP_S_MEM_W1_BUS_END(v)); 363 CHIP_S_MEM_W1_BUS_START(v), CHIP_S_MEM_W1_BUS_END(v));
364#endif 364#endif
365 extent_free(sex, CHIP_S_MEM_W1_BUS_START(v), 365 extent_free(sex, CHIP_S_MEM_W1_BUS_START(v),
366 CHIP_S_MEM_W1_BUS_END(v) - CHIP_S_MEM_W1_BUS_START(v) + 1, 366 CHIP_S_MEM_W1_BUS_END(v) - CHIP_S_MEM_W1_BUS_START(v) + 1,
367 EX_NOWAIT); 367 EX_NOWAIT);
368#endif 368#endif

cvs diff -r1.11 -r1.12 src/sys/arch/arc/arc/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/arc/arc/bus_space.c 2011/07/17 01:36:50 1.11
+++ src/sys/arch/arc/arc/bus_space.c 2012/01/27 18:52:49 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.11 2011/07/17 01:36:50 dyoung Exp $ */ 1/* $NetBSD: bus_space.c,v 1.12 2012/01/27 18:52:49 para Exp $ */
2/* NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp */ 2/* NetBSD: bus_machdep.c,v 1.1 2000/01/26 18:48:00 drochner Exp */
3 3
4/*- 4/*-
5 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 5 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace 9 * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace
10 * Simulation Facility, NASA Ames Research Center. 10 * Simulation Facility, NASA Ames Research Center.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.11 2011/07/17 01:36:50 dyoung Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.12 2012/01/27 18:52:49 para Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40#include <sys/extent.h> 40#include <sys/extent.h>
41 41
42#include <uvm/uvm_extern.h> 42#include <uvm/uvm_extern.h>
43 43
44#include <sys/bus.h> 44#include <sys/bus.h>
45 45
46/* 46/*
47 * uintN_t bus_space_read_N(bus_space_tag_t tag, 47 * uintN_t bus_space_read_N(bus_space_tag_t tag,
48 * bus_space_handle_t bsh, bus_size_t offset); 48 * bus_space_handle_t bsh, bus_size_t offset);
@@ -333,27 +333,27 @@ arc_bus_space_init(bus_space_tag_t bst,  @@ -333,27 +333,27 @@ arc_bus_space_init(bus_space_tag_t bst,
333 bst->bs_aux = NULL; 333 bst->bs_aux = NULL;
334 bst->bs_stride_1 = 0; 334 bst->bs_stride_1 = 0;
335 bst->bs_stride_2 = 0; 335 bst->bs_stride_2 = 0;
336 bst->bs_stride_4 = 0; 336 bst->bs_stride_4 = 0;
337 bst->bs_stride_8 = 0; 337 bst->bs_stride_8 = 0;
338} 338}
339 339
340void 340void
341arc_bus_space_init_extent(bus_space_tag_t bst, void *storage, 341arc_bus_space_init_extent(bus_space_tag_t bst, void *storage,
342 size_t storagesize) 342 size_t storagesize)
343{ 343{
344 344
345 bst->bs_extent = extent_create(bst->bs_name, 345 bst->bs_extent = extent_create(bst->bs_name,
346 bst->bs_start, bst->bs_start + bst->bs_size, M_DEVBUF, 346 bst->bs_start, bst->bs_start + bst->bs_size,
347 storage, storagesize, EX_NOWAIT); 347 storage, storagesize, EX_NOWAIT);
348 if (bst->bs_extent == NULL) 348 if (bst->bs_extent == NULL)
349 panic("arc_bus_space_init_extent: cannot create extent map %s", 349 panic("arc_bus_space_init_extent: cannot create extent map %s",
350 bst->bs_name); 350 bst->bs_name);
351} 351}
352 352
353void 353void
354arc_bus_space_set_aligned_stride(bus_space_tag_t bst, 354arc_bus_space_set_aligned_stride(bus_space_tag_t bst,
355 unsigned int alignment_shift) 355 unsigned int alignment_shift)
356{ 356{
357 357
358 bst->bs_stride_1 = alignment_shift; 358 bst->bs_stride_1 = alignment_shift;
359 if (alignment_shift > 0) 359 if (alignment_shift > 0)

cvs diff -r1.6 -r1.7 src/sys/arch/arc/arc/wired_map_machdep.c (expand / switch to unified diff)

--- src/sys/arch/arc/arc/wired_map_machdep.c 2009/12/16 23:19:06 1.6
+++ src/sys/arch/arc/arc/wired_map_machdep.c 2012/01/27 18:52:50 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: wired_map_machdep.c,v 1.6 2009/12/16 23:19:06 matt Exp $ */ 1/* $NetBSD: wired_map_machdep.c,v 1.7 2012/01/27 18:52:50 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (C) 2000 Shuichiro URATA. All rights reserved. 4 * Copyright (C) 2000 Shuichiro URATA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products 14 * 3. The name of the author may not be used to endorse or promote products
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: wired_map_machdep.c,v 1.6 2009/12/16 23:19:06 matt Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: wired_map_machdep.c,v 1.7 2012/01/27 18:52:50 para Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/malloc.h> 34#include <sys/malloc.h>
35#include <sys/extent.h> 35#include <sys/extent.h>
36 36
37#include <uvm/uvm_extern.h> 37#include <uvm/uvm_extern.h>
38#include <machine/cpu.h> 38#include <machine/cpu.h>
39#include <machine/wired_map.h> 39#include <machine/wired_map.h>
40#include <machine/vmparam.h> 40#include <machine/vmparam.h>
41#include <mips/locore.h> 41#include <mips/locore.h>
42#include <mips/pte.h> 42#include <mips/pte.h>
43 43
@@ -45,27 +45,27 @@ static bool arc_wired_map_paddr_entry(pa @@ -45,27 +45,27 @@ static bool arc_wired_map_paddr_entry(pa
45 vsize_t *sizep); 45 vsize_t *sizep);
46static bool arc_wired_map_vaddr_entry(vaddr_t va, paddr_t *pap, 46static bool arc_wired_map_vaddr_entry(vaddr_t va, paddr_t *pap,
47 vsize_t *sizep); 47 vsize_t *sizep);
48 48
49static struct extent *arc_wired_map_ex; 49static struct extent *arc_wired_map_ex;
50static long wired_map_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8) / sizeof(long)]; 50static long wired_map_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8) / sizeof(long)];
51 51
52void 52void
53arc_init_wired_map(void) 53arc_init_wired_map(void)
54{ 54{
55 55
56 mips3_nwired_page = 0; 56 mips3_nwired_page = 0;
57 arc_wired_map_ex = extent_create("wired_map", 57 arc_wired_map_ex = extent_create("wired_map",
58 VM_MIN_WIRED_MAP_ADDRESS, VM_MAX_WIRED_MAP_ADDRESS, M_DEVBUF, 58 VM_MIN_WIRED_MAP_ADDRESS, VM_MAX_WIRED_MAP_ADDRESS,
59 (void *)wired_map_ex_storage, sizeof(wired_map_ex_storage), 59 (void *)wired_map_ex_storage, sizeof(wired_map_ex_storage),
60 EX_NOWAIT); 60 EX_NOWAIT);
61 if (arc_wired_map_ex == NULL) 61 if (arc_wired_map_ex == NULL)
62 panic("arc_init_wired_map: can't create extent"); 62 panic("arc_init_wired_map: can't create extent");
63} 63}
64 64
65void 65void
66arc_wired_enter_page(vaddr_t va, paddr_t pa, vaddr_t pg_size) 66arc_wired_enter_page(vaddr_t va, paddr_t pa, vaddr_t pg_size)
67{ 67{
68 int error; 68 int error;
69 69
70 KASSERT((va & (pg_size - 1)) == 0); 70 KASSERT((va & (pg_size - 1)) == 0);
71 71

cvs diff -r1.15 -r1.16 src/sys/arch/arc/jazz/jazzdmatlb.c (expand / switch to unified diff)

--- src/sys/arch/arc/jazz/jazzdmatlb.c 2011/07/01 19:25:41 1.15
+++ src/sys/arch/arc/jazz/jazzdmatlb.c 2012/01/27 18:52:50 1.16
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: jazzdmatlb.c,v 1.15 2011/07/01 19:25:41 dyoung Exp $ */ 1/* $NetBSD: jazzdmatlb.c,v 1.16 2012/01/27 18:52:50 para Exp $ */
2/* $OpenBSD: dma.c,v 1.5 1998/03/01 16:49:57 niklas Exp $ */ 2/* $OpenBSD: dma.c,v 1.5 1998/03/01 16:49:57 niklas Exp $ */
3 3
4/*- 4/*-
5 * Copyright (C) 2000 Shuichiro URATA. All rights reserved. 5 * Copyright (C) 2000 Shuichiro URATA. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30/* 30/*
31 * Jazz derived system dma driver. Handles resource allocation and 31 * Jazz derived system dma driver. Handles resource allocation and
32 * logical (virtual) address remaping. 32 * logical (virtual) address remaping.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: jazzdmatlb.c,v 1.15 2011/07/01 19:25:41 dyoung Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: jazzdmatlb.c,v 1.16 2012/01/27 18:52:50 para Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/proc.h> 43#include <sys/proc.h>
44 44
45#include <uvm/uvm_extern.h> 45#include <uvm/uvm_extern.h>
46 46
47#include <machine/autoconf.h> 47#include <machine/autoconf.h>
48#include <sys/bus.h> 48#include <sys/bus.h>
49 49
@@ -75,28 +75,27 @@ jazz_dmatlb_init(bus_space_tag_t iot, bu @@ -75,28 +75,27 @@ jazz_dmatlb_init(bus_space_tag_t iot, bu
75{ 75{
76 int err; 76 int err;
77 77
78 dmatlb_iot = iot; 78 dmatlb_iot = iot;
79 err = bus_space_map(iot, ioaddr, JAZZ_DMATLB_REGSIZE, 0, &dmatlb_ioh); 79 err = bus_space_map(iot, ioaddr, JAZZ_DMATLB_REGSIZE, 0, &dmatlb_ioh);
80 if (err != 0) 80 if (err != 0)
81 panic("jazz_dmatlb_init: cannot map 0x%lx", ioaddr); 81 panic("jazz_dmatlb_init: cannot map 0x%lx", ioaddr);
82 82
83 dma_tlb = (jazz_dma_pte_t *)PICA_TL_BASE; 83 dma_tlb = (jazz_dma_pte_t *)PICA_TL_BASE;
84 84
85 mips_dcache_wbinv_all();/* Make sure no map entries are cached */ 85 mips_dcache_wbinv_all();/* Make sure no map entries are cached */
86 memset((char *)dma_tlb, 0, JAZZ_DMATLB_SIZE); 86 memset((char *)dma_tlb, 0, JAZZ_DMATLB_SIZE);
87 87
88 dmatlbmap = extent_create("dmatlb", 0, NDMATLB, M_DEVBUF, NULL, 0, 88 dmatlbmap = extent_create("dmatlb", 0, NDMATLB, NULL, 0, EX_NOWAIT);
89 EX_NOWAIT); 
90 if (dmatlbmap == NULL) 89 if (dmatlbmap == NULL)
91 panic("jazz_dmatlb_init: cannot create extent map"); 90 panic("jazz_dmatlb_init: cannot create extent map");
92 91
93 bus_space_write_4(dmatlb_iot, dmatlb_ioh, JAZZ_DMATLBREG_MAP, 92 bus_space_write_4(dmatlb_iot, dmatlb_ioh, JAZZ_DMATLBREG_MAP,
94 MIPS_KSEG1_TO_PHYS(dma_tlb)); 93 MIPS_KSEG1_TO_PHYS(dma_tlb));
95 bus_space_write_4(dmatlb_iot, dmatlb_ioh, JAZZ_DMATLBREG_LIMIT, 94 bus_space_write_4(dmatlb_iot, dmatlb_ioh, JAZZ_DMATLBREG_LIMIT,
96 JAZZ_DMATLB_SIZE); 95 JAZZ_DMATLB_SIZE);
97 jazz_dmatlb_flush(); 96 jazz_dmatlb_flush();
98} 97}
99 98
100/* 99/*
101 * Allocate an array of 'size' DMA PTEs. 100 * Allocate an array of 'size' DMA PTEs.
102 * Return address to first pte. 101 * Return address to first pte.

cvs diff -r1.37 -r1.38 src/sys/arch/arc/pci/necpb.c (expand / switch to unified diff)

--- src/sys/arch/arc/pci/necpb.c 2011/07/01 19:28:00 1.37
+++ src/sys/arch/arc/pci/necpb.c 2012/01/27 18:52:50 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: necpb.c,v 1.37 2011/07/01 19:28:00 dyoung Exp $ */ 1/* $NetBSD: necpb.c,v 1.38 2012/01/27 18:52:50 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 51 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
54 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 54 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
55 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 55 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
56 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 56 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
60 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.37 2011/07/01 19:28:00 dyoung Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: necpb.c,v 1.38 2012/01/27 18:52:50 para Exp $");
65 65
66#include "opt_pci.h" 66#include "opt_pci.h"
67 67
68#include <sys/types.h> 68#include <sys/types.h>
69#include <sys/param.h> 69#include <sys/param.h>
70#include <sys/time.h> 70#include <sys/time.h>
71#include <sys/systm.h> 71#include <sys/systm.h>
72#include <sys/errno.h> 72#include <sys/errno.h>
73#include <sys/device.h> 73#include <sys/device.h>
74#include <sys/malloc.h> 74#include <sys/malloc.h>
75#include <sys/extent.h> 75#include <sys/extent.h>
76 76
77#include <uvm/uvm_extern.h> 77#include <uvm/uvm_extern.h>
@@ -233,29 +233,29 @@ necpbattach(device_t parent, device_t se @@ -233,29 +233,29 @@ necpbattach(device_t parent, device_t se
233 233
234 sc->sc_dev = self; 234 sc->sc_dev = self;
235 235
236 necpbfound = 1; 236 necpbfound = 1;
237 237
238 aprint_normal("\n"); 238 aprint_normal("\n");
239 239
240 sc->sc_ncp = &necpb_main_context; 240 sc->sc_ncp = &necpb_main_context;
241 necpb_init(sc->sc_ncp); 241 necpb_init(sc->sc_ncp);
242 242
243 pc = &sc->sc_ncp->nc_pc; 243 pc = &sc->sc_ncp->nc_pc;
244#ifdef PCI_NETBSD_CONFIGURE 244#ifdef PCI_NETBSD_CONFIGURE
245 pc->pc_ioext = extent_create("necpbio", 0x00100000, 0x01ffffff, 245 pc->pc_ioext = extent_create("necpbio", 0x00100000, 0x01ffffff,
246 M_DEVBUF, NULL, 0, EX_NOWAIT); 246 NULL, 0, EX_NOWAIT);
247 pc->pc_memext = extent_create("necpbmem", 0x08000000, 0x3fffffff, 247 pc->pc_memext = extent_create("necpbmem", 0x08000000, 0x3fffffff,
248 M_DEVBUF, NULL, 0, EX_NOWAIT); 248 NULL, 0, EX_NOWAIT);
249 pci_configure_bus(pc, pc->pc_ioext, pc->pc_memext, NULL, 0, 249 pci_configure_bus(pc, pc->pc_ioext, pc->pc_memext, NULL, 0,
250 mips_cache_info.mci_dcache_align); 250 mips_cache_info.mci_dcache_align);
251#endif 251#endif
252 252
253 out32(RD94_SYS_PCI_INTMASK, 0xf); 253 out32(RD94_SYS_PCI_INTMASK, 0xf);
254 254
255 for (i = 0; i < 4; i++) 255 for (i = 0; i < 4; i++)
256 necpb_inttbl[i] = NULL; 256 necpb_inttbl[i] = NULL;
257 257
258 (*platform->set_intr)(MIPS_INT_MASK_2, necpb_intr, ARC_INTPRI_PCIISA); 258 (*platform->set_intr)(MIPS_INT_MASK_2, necpb_intr, ARC_INTPRI_PCIISA);
259 259
260 pba.pba_iot = &sc->sc_ncp->nc_iot; 260 pba.pba_iot = &sc->sc_ncp->nc_iot;
261 pba.pba_memt = &sc->sc_ncp->nc_memt; 261 pba.pba_memt = &sc->sc_ncp->nc_memt;

cvs diff -r1.10 -r1.11 src/sys/arch/arm/gemini/gemini_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/gemini/gemini_pci.c 2011/07/01 19:32:28 1.10
+++ src/sys/arch/arm/gemini/gemini_pci.c 2012/01/27 18:52:50 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gemini_pci.c,v 1.10 2011/07/01 19:32:28 dyoung Exp $ */ 1/* $NetBSD: gemini_pci.c,v 1.11 2012/01/27 18:52:50 para Exp $ */
2 2
3/* adapted from: 3/* adapted from:
4 * NetBSD: i80312_pci.c,v 1.9 2005/12/11 12:16:51 christos Exp 4 * NetBSD: i80312_pci.c,v 1.9 2005/12/11 12:16:51 christos Exp
5 */ 5 */
6 6
7/* 7/*
8 * Copyright (c) 2001 Wasabi Systems, Inc. 8 * Copyright (c) 2001 Wasabi Systems, Inc.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 11 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -34,27 +34,27 @@ @@ -34,27 +34,27 @@
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE. 39 * POSSIBILITY OF SUCH DAMAGE.
40 */ 40 */
41 41
42/* 42/*
43 * PCI configuration support for i80312 Companion I/O chip. 43 * PCI configuration support for i80312 Companion I/O chip.
44 */ 44 */
45 45
46#include <sys/cdefs.h> 46#include <sys/cdefs.h>
47__KERNEL_RCSID(0, "$NetBSD: gemini_pci.c,v 1.10 2011/07/01 19:32:28 dyoung Exp $"); 47__KERNEL_RCSID(0, "$NetBSD: gemini_pci.c,v 1.11 2012/01/27 18:52:50 para Exp $");
48 48
49#include <sys/cdefs.h> 49#include <sys/cdefs.h>
50 50
51#include <sys/param.h> 51#include <sys/param.h>
52#include <sys/systm.h> 52#include <sys/systm.h>
53#include <sys/device.h> 53#include <sys/device.h>
54#include <sys/extent.h> 54#include <sys/extent.h>
55#include <sys/malloc.h> 55#include <sys/malloc.h>
56 56
57#include <uvm/uvm_extern.h> 57#include <uvm/uvm_extern.h>
58 58
59#include <sys/bus.h> 59#include <sys/bus.h>
60#include <machine/intr.h> 60#include <machine/intr.h>
@@ -201,35 +201,35 @@ gemini_pci_init(pci_chipset_tag_t pc, vo @@ -201,35 +201,35 @@ gemini_pci_init(pci_chipset_tag_t pc, vo
201 * need to only configure devices in the private device space on 201 * need to only configure devices in the private device space on
202 * the Secondary bus. 202 * the Secondary bus.
203 */ 203 */
204 204
205 aprint_normal("%s: configuring Secondary PCI bus\n", 205 aprint_normal("%s: configuring Secondary PCI bus\n",
206 device_xname(sc->sc_dev)); 206 device_xname(sc->sc_dev));
207 207
208 /* 208 /*
209 * XXX PCI IO addr should be inherited ? 209 * XXX PCI IO addr should be inherited ?
210 */ 210 */
211 ioext = extent_create("pciio", 211 ioext = extent_create("pciio",
212 GEMINI_PCIIO_BASE, 212 GEMINI_PCIIO_BASE,
213 GEMINI_PCIIO_BASE + GEMINI_PCIIO_SIZE - 1, 213 GEMINI_PCIIO_BASE + GEMINI_PCIIO_SIZE - 1,
214 M_DEVBUF, NULL, 0, EX_NOWAIT); 214 NULL, 0, EX_NOWAIT);
215 215
216 /* 216 /*
217 * XXX PCI mem addr should be inherited ? 217 * XXX PCI mem addr should be inherited ?
218 */ 218 */
219 memext = extent_create("pcimem", 219 memext = extent_create("pcimem",
220 GEMINI_PCIMEM_BASE, 220 GEMINI_PCIMEM_BASE,
221 GEMINI_PCIMEM_BASE + GEMINI_PCIMEM_SIZE - 1, 221 GEMINI_PCIMEM_BASE + GEMINI_PCIMEM_SIZE - 1,
222 M_DEVBUF, NULL, 0, EX_NOWAIT); 222 NULL, 0, EX_NOWAIT);
223 223
224 pci_configure_bus(pc, ioext, memext, NULL, 0, arm_dcache_align); 224 pci_configure_bus(pc, ioext, memext, NULL, 0, arm_dcache_align);
225 225
226 gemini_pci_conf_write(sc, 0, GEMINI_PCI_CFG_REG_MEM1, 226 gemini_pci_conf_write(sc, 0, GEMINI_PCI_CFG_REG_MEM1,
227 PCI_CFG_REG_MEM_BASE((GEMINI_DRAM_BASE + (GEMINI_BUSBASE * 1024 * 1024))) 227 PCI_CFG_REG_MEM_BASE((GEMINI_DRAM_BASE + (GEMINI_BUSBASE * 1024 * 1024)))
228 | gemini_pci_cfg_reg_mem_size(MEMSIZE * 1024 * 1024)); 228 | gemini_pci_cfg_reg_mem_size(MEMSIZE * 1024 * 1024));
229 229
230 extent_destroy(ioext); 230 extent_destroy(ioext);
231 extent_destroy(memext); 231 extent_destroy(memext);
232#endif 232#endif
233} 233}
234 234
235void 235void

cvs diff -r1.10 -r1.11 src/sys/arch/arm/ixp12x0/ixp12x0_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/ixp12x0/ixp12x0_pci.c 2009/03/14 21:04:05 1.10
+++ src/sys/arch/arm/ixp12x0/ixp12x0_pci.c 2012/01/27 18:52:51 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ixp12x0_pci.c,v 1.10 2009/03/14 21:04:05 dsl Exp $ */ 1/* $NetBSD: ixp12x0_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $ */
2/* 2/*
3 * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. 3 * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Ichiro FUKUHARA and Naoto Shimazaki. 7 * by Ichiro FUKUHARA and Naoto Shimazaki.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: ixp12x0_pci.c,v 1.10 2009/03/14 21:04:05 dsl Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: ixp12x0_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $");
33 33
34/* 34/*
35 * PCI configuration support for IXP12x0 Network Processor chip. 35 * PCI configuration support for IXP12x0 Network Processor chip.
36 */ 36 */
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43 43
44#include <uvm/uvm_extern.h> 44#include <uvm/uvm_extern.h>
45 45
@@ -85,32 +85,32 @@ ixp12x0_pci_init(pci_chipset_tag_t pc, v @@ -85,32 +85,32 @@ ixp12x0_pci_init(pci_chipset_tag_t pc, v
85 struct ixp12x0_softc *sc = cookie; 85 struct ixp12x0_softc *sc = cookie;
86 struct extent *ioext, *memext; 86 struct extent *ioext, *memext;
87#endif 87#endif
88 pc->pc_conf_v = cookie; 88 pc->pc_conf_v = cookie;
89 pc->pc_attach_hook = ixp12x0_pci_attach_hook; 89 pc->pc_attach_hook = ixp12x0_pci_attach_hook;
90 pc->pc_bus_maxdevs = ixp12x0_pci_bus_maxdevs; 90 pc->pc_bus_maxdevs = ixp12x0_pci_bus_maxdevs;
91 pc->pc_make_tag = ixp12x0_pci_make_tag; 91 pc->pc_make_tag = ixp12x0_pci_make_tag;
92 pc->pc_decompose_tag = ixp12x0_pci_decompose_tag; 92 pc->pc_decompose_tag = ixp12x0_pci_decompose_tag;
93 pc->pc_conf_read = ixp12x0_pci_conf_read; 93 pc->pc_conf_read = ixp12x0_pci_conf_read;
94 pc->pc_conf_write = ixp12x0_pci_conf_write; 94 pc->pc_conf_write = ixp12x0_pci_conf_write;
95 95
96#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE) 96#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE)
97 ioext = extent_create("pciio", 0, IXP12X0_PCI_IO_SIZE - 1, 97 ioext = extent_create("pciio", 0, IXP12X0_PCI_IO_SIZE - 1,
98 M_DEVBUF, NULL, 0, EX_NOWAIT); 98 NULL, 0, EX_NOWAIT);
99 /* PCI MEM space is mapped same address as real memory */ 99 /* PCI MEM space is mapped same address as real memory */
100 memext = extent_create("pcimem", IXP12X0_PCI_MEM_HWBASE, 100 memext = extent_create("pcimem", IXP12X0_PCI_MEM_HWBASE,
101 IXP12X0_PCI_MEM_HWBASE + 101 IXP12X0_PCI_MEM_HWBASE +
102 IXP12X0_PCI_MEM_SIZE - 1, 102 IXP12X0_PCI_MEM_SIZE - 1,
103 M_DEVBUF, NULL, 0, EX_NOWAIT); 103 NULL, 0, EX_NOWAIT);
104 printf("%s: configuring PCI bus\n", sc->sc_dev.dv_xname); 104 printf("%s: configuring PCI bus\n", sc->sc_dev.dv_xname);
105 pci_configure_bus(pc, ioext, memext, NULL, 0 /* XXX bus = 0 */, 105 pci_configure_bus(pc, ioext, memext, NULL, 0 /* XXX bus = 0 */,
106 arm_dcache_align); 106 arm_dcache_align);
107 107
108 extent_destroy(ioext); 108 extent_destroy(ioext);
109 extent_destroy(memext); 109 extent_destroy(memext);
110#endif 110#endif
111} 111}
112 112
113void 113void
114pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p) 114pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p)
115{ 115{
116 /* Nothing */ 116 /* Nothing */

cvs diff -r1.16 -r1.17 src/sys/arch/arm/s3c2xx0/s3c2800_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/s3c2xx0/s3c2800_pci.c 2011/07/01 20:31:39 1.16
+++ src/sys/arch/arm/s3c2xx0/s3c2800_pci.c 2012/01/27 18:52:51 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: s3c2800_pci.c,v 1.16 2011/07/01 20:31:39 dyoung Exp $ */ 1/* $NetBSD: s3c2800_pci.c,v 1.17 2012/01/27 18:52:51 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002 Fujitsu Component Limited 4 * Copyright (c) 2002 Fujitsu Component Limited
5 * Copyright (c) 2002 Genetec Corporation 5 * Copyright (c) 2002 Genetec Corporation
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -90,27 +90,27 @@ @@ -90,27 +90,27 @@
90 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 90 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
91 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 91 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
92 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 92 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
93 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 93 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
94 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 94 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
95 * SUCH DAMAGE. 95 * SUCH DAMAGE.
96 */ 96 */
97 97
98/* 98/*
99 * PCI configuration support for Samsung s3c2800. 99 * PCI configuration support for Samsung s3c2800.
100 */ 100 */
101 101
102#include <sys/cdefs.h> 102#include <sys/cdefs.h>
103__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.16 2011/07/01 20:31:39 dyoung Exp $"); 103__KERNEL_RCSID(0, "$NetBSD: s3c2800_pci.c,v 1.17 2012/01/27 18:52:51 para Exp $");
104 104
105#include <sys/param.h> 105#include <sys/param.h>
106#include <sys/systm.h> 106#include <sys/systm.h>
107#include <sys/kernel.h> 107#include <sys/kernel.h>
108#include <sys/device.h> 108#include <sys/device.h>
109#include <sys/extent.h> 109#include <sys/extent.h>
110#include <sys/malloc.h> 110#include <sys/malloc.h>
111 111
112#include <uvm/uvm_extern.h> 112#include <uvm/uvm_extern.h>
113 113
114#include <sys/bus.h> 114#include <sys/bus.h>
115 115
116#include <arm/s3c2xx0/s3c2800reg.h> 116#include <arm/s3c2xx0/s3c2800reg.h>
@@ -283,30 +283,30 @@ sspci_attach(struct device *parent, stru @@ -283,30 +283,30 @@ sspci_attach(struct device *parent, stru
283 char buf[1000]; 283 char buf[1000];
284 284
285 id_reg = bus_space_read_4(iot, sc->sc_reg_ioh, 285 id_reg = bus_space_read_4(iot, sc->sc_reg_ioh,
286 PCI_ID_REG); 286 PCI_ID_REG);
287 class_reg = bus_space_read_4(iot, 287 class_reg = bus_space_read_4(iot,
288 sc->sc_reg_ioh, PCI_CLASS_REG); 288 sc->sc_reg_ioh, PCI_CLASS_REG);
289 289
290 pci_devinfo(id_reg, class_reg, 1, buf, sizeof(buf)); 290 pci_devinfo(id_reg, class_reg, 1, buf, sizeof(buf));
291 printf("%s: %s\n", self->dv_xname, buf); 291 printf("%s: %s\n", self->dv_xname, buf);
292 } 292 }
293 293
294#if defined(PCI_NETBSD_CONFIGURE) 294#if defined(PCI_NETBSD_CONFIGURE)
295 ioext = extent_create("pciio", 0x100, S3C2800_PCI_IOSPACE_SIZE - 0x100, 295 ioext = extent_create("pciio", 0x100, S3C2800_PCI_IOSPACE_SIZE - 0x100,
296 M_DEVBUF, NULL, 0, EX_NOWAIT); 296 NULL, 0, EX_NOWAIT);
297 297
298 memext = extent_create("pcimem", 0, S3C2800_PCI_MEMSPACE_SIZE, 298 memext = extent_create("pcimem", 0, S3C2800_PCI_MEMSPACE_SIZE,
299 M_DEVBUF, NULL, 0, EX_NOWAIT); 299 NULL, 0, EX_NOWAIT);
300 300
301 sspci_chipset.pc_conf_v = (void *) sc; 301 sspci_chipset.pc_conf_v = (void *) sc;
302 sspci_chipset.pc_intr_v = (void *) sc; 302 sspci_chipset.pc_intr_v = (void *) sc;
303 303
304 pci_configure_bus(&sspci_chipset, ioext, memext, NULL, 0, 304 pci_configure_bus(&sspci_chipset, ioext, memext, NULL, 0,
305 arm_dcache_align); 305 arm_dcache_align);
306 306
307 extent_destroy(memext); 307 extent_destroy(memext);
308 extent_destroy(ioext); 308 extent_destroy(ioext);
309#endif /* PCI_NETBSD_CONFIGURE */ 309#endif /* PCI_NETBSD_CONFIGURE */
310 310
311 /* initialize bus space tag */ 311 /* initialize bus space tag */
312 sspci_io_tag = *iot; 312 sspci_io_tag = *iot;

cvs diff -r1.10 -r1.11 src/sys/arch/arm/xscale/becc_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/xscale/becc_pci.c 2011/07/01 20:32:51 1.10
+++ src/sys/arch/arm/xscale/becc_pci.c 2012/01/27 18:52:51 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: becc_pci.c,v 1.10 2011/07/01 20:32:51 dyoung Exp $ */ 1/* $NetBSD: becc_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -31,27 +31,27 @@ @@ -31,27 +31,27 @@
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38/* 38/*
39 * PCI configuration support for the ADI Engineering Big Endian Companion 39 * PCI configuration support for the ADI Engineering Big Endian Companion
40 * Chip. 40 * Chip.
41 */ 41 */
42 42
43#include <sys/cdefs.h> 43#include <sys/cdefs.h>
44__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.10 2011/07/01 20:32:51 dyoung Exp $"); 44__KERNEL_RCSID(0, "$NetBSD: becc_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $");
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/device.h> 48#include <sys/device.h>
49#include <sys/extent.h> 49#include <sys/extent.h>
50#include <sys/malloc.h> 50#include <sys/malloc.h>
51 51
52#include <uvm/uvm_extern.h> 52#include <uvm/uvm_extern.h>
53 53
54#include <sys/bus.h> 54#include <sys/bus.h>
55 55
56#include <arm/xscale/beccreg.h> 56#include <arm/xscale/beccreg.h>
57#include <arm/xscale/beccvar.h> 57#include <arm/xscale/beccvar.h>
@@ -115,30 +115,30 @@ becc_pci_init(pci_chipset_tag_t pc, void @@ -115,30 +115,30 @@ becc_pci_init(pci_chipset_tag_t pc, void
115 /* 115 /*
116 * Configure the PCI bus. 116 * Configure the PCI bus.
117 * 117 *
118 * XXX We need to revisit this. We only configure the Secondary 118 * XXX We need to revisit this. We only configure the Secondary
119 * bus (and its children). The bus configure code needs changes 119 * bus (and its children). The bus configure code needs changes
120 * to support how the busses are arranged on this chip. We also 120 * to support how the busses are arranged on this chip. We also
121 * need to only configure devices in the private device space on 121 * need to only configure devices in the private device space on
122 * the Secondary bus. 122 * the Secondary bus.
123 */ 123 */
124 124
125 /* Reserve the bottom 32K of the PCI address space. */ 125 /* Reserve the bottom 32K of the PCI address space. */
126 ioext = extent_create("pciio", sc->sc_ioout_xlate + (32 * 1024), 126 ioext = extent_create("pciio", sc->sc_ioout_xlate + (32 * 1024),
127 sc->sc_ioout_xlate + (64 * 1024) - 1, 127 sc->sc_ioout_xlate + (64 * 1024) - 1,
128 M_DEVBUF, NULL, 0, EX_NOWAIT); 128 NULL, 0, EX_NOWAIT);
129 memext = extent_create("pcimem", sc->sc_owin_xlate[0], 129 memext = extent_create("pcimem", sc->sc_owin_xlate[0],
130 sc->sc_owin_xlate[0] + BECC_PCI_MEM1_SIZE - 1, 130 sc->sc_owin_xlate[0] + BECC_PCI_MEM1_SIZE - 1,
131 M_DEVBUF, NULL, 0, EX_NOWAIT); 131 NULL, 0, EX_NOWAIT);
132 132
133 aprint_normal("%s: configuring PCI bus\n", sc->sc_dev.dv_xname); 133 aprint_normal("%s: configuring PCI bus\n", sc->sc_dev.dv_xname);
134 pci_configure_bus(pc, ioext, memext, NULL, 0, arm_dcache_align); 134 pci_configure_bus(pc, ioext, memext, NULL, 0, arm_dcache_align);
135 135
136 extent_destroy(ioext); 136 extent_destroy(ioext);
137 extent_destroy(memext); 137 extent_destroy(memext);
138#endif 138#endif
139} 139}
140 140
141void 141void
142pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p) 142pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p)
143{ 143{
144} 144}

cvs diff -r1.10 -r1.11 src/sys/arch/arm/xscale/i80312_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/xscale/i80312_pci.c 2011/07/01 20:32:51 1.10
+++ src/sys/arch/arm/xscale/i80312_pci.c 2012/01/27 18:52:51 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: i80312_pci.c,v 1.10 2011/07/01 20:32:51 dyoung Exp $ */ 1/* $NetBSD: i80312_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wasabi Systems, Inc. 4 * Copyright (c) 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38/* 38/*
39 * PCI configuration support for i80312 Companion I/O chip. 39 * PCI configuration support for i80312 Companion I/O chip.
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: i80312_pci.c,v 1.10 2011/07/01 20:32:51 dyoung Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: i80312_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $");
44 44
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/device.h> 47#include <sys/device.h>
48#include <sys/extent.h> 48#include <sys/extent.h>
49#include <sys/malloc.h> 49#include <sys/malloc.h>
50 50
51#include <uvm/uvm_extern.h> 51#include <uvm/uvm_extern.h>
52 52
53#include <sys/bus.h> 53#include <sys/bus.h>
54 54
55#include <arm/xscale/i80312reg.h> 55#include <arm/xscale/i80312reg.h>
56#include <arm/xscale/i80312var.h> 56#include <arm/xscale/i80312var.h>
@@ -98,30 +98,30 @@ i80312_pci_init(pci_chipset_tag_t pc, vo @@ -98,30 +98,30 @@ i80312_pci_init(pci_chipset_tag_t pc, vo
98 * XXX We need to revisit this. We only configure the Secondary 98 * XXX We need to revisit this. We only configure the Secondary
99 * bus (and its children). The bus configure code needs changes 99 * bus (and its children). The bus configure code needs changes
100 * to support how the busses are arranged on this chip. We also 100 * to support how the busses are arranged on this chip. We also
101 * need to only configure devices in the private device space on 101 * need to only configure devices in the private device space on
102 * the Secondary bus. 102 * the Secondary bus.
103 */ 103 */
104 104
105 binfo = bus_space_read_4(sc->sc_st, sc->sc_ppb_sh, PPB_REG_BUSINFO); 105 binfo = bus_space_read_4(sc->sc_st, sc->sc_ppb_sh, PPB_REG_BUSINFO);
106 pbus = PPB_BUSINFO_PRIMARY(binfo); 106 pbus = PPB_BUSINFO_PRIMARY(binfo);
107 sbus = PPB_BUSINFO_SECONDARY(binfo); 107 sbus = PPB_BUSINFO_SECONDARY(binfo);
108 108
109 ioext = extent_create("pciio", sc->sc_sioout_base, 109 ioext = extent_create("pciio", sc->sc_sioout_base,
110 sc->sc_sioout_base + sc->sc_sioout_size - 1, 110 sc->sc_sioout_base + sc->sc_sioout_size - 1,
111 M_DEVBUF, NULL, 0, EX_NOWAIT); 111 NULL, 0, EX_NOWAIT);
112 memext = extent_create("pcimem", sc->sc_smemout_base, 112 memext = extent_create("pcimem", sc->sc_smemout_base,
113 sc->sc_smemout_base + sc->sc_smemout_size - 1, 113 sc->sc_smemout_base + sc->sc_smemout_size - 1,
114 M_DEVBUF, NULL, 0, EX_NOWAIT); 114 NULL, 0, EX_NOWAIT);
115 115
116 aprint_normal("%s: configuring Secondary PCI bus\n", sc->sc_dev.dv_xname); 116 aprint_normal("%s: configuring Secondary PCI bus\n", sc->sc_dev.dv_xname);
117 pci_configure_bus(pc, ioext, memext, NULL, sbus, arm_dcache_align); 117 pci_configure_bus(pc, ioext, memext, NULL, sbus, arm_dcache_align);
118 118
119 extent_destroy(ioext); 119 extent_destroy(ioext);
120 extent_destroy(memext); 120 extent_destroy(memext);
121#endif 121#endif
122} 122}
123 123
124void 124void
125pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p) 125pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p)
126{ 126{
127} 127}

cvs diff -r1.10 -r1.11 src/sys/arch/arm/xscale/i80321_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/xscale/i80321_pci.c 2011/07/01 20:32:51 1.10
+++ src/sys/arch/arm/xscale/i80321_pci.c 2012/01/27 18:52:51 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: i80321_pci.c,v 1.10 2011/07/01 20:32:51 dyoung Exp $ */ 1/* $NetBSD: i80321_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38/* 38/*
39 * PCI configuration support for i80321 I/O Processor chip. 39 * PCI configuration support for i80321 I/O Processor chip.
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: i80321_pci.c,v 1.10 2011/07/01 20:32:51 dyoung Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: i80321_pci.c,v 1.11 2012/01/27 18:52:51 para Exp $");
44 44
45#include <sys/param.h> 45#include <sys/param.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/device.h> 47#include <sys/device.h>
48#include <sys/extent.h> 48#include <sys/extent.h>
49#include <sys/malloc.h> 49#include <sys/malloc.h>
50 50
51#include <uvm/uvm_extern.h> 51#include <uvm/uvm_extern.h>
52 52
53#include <sys/bus.h> 53#include <sys/bus.h>
54 54
55#include <arm/xscale/i80321reg.h> 55#include <arm/xscale/i80321reg.h>
56#include <arm/xscale/i80321var.h> 56#include <arm/xscale/i80321var.h>
@@ -100,36 +100,36 @@ i80321_pci_init(pci_chipset_tag_t pc, vo @@ -100,36 +100,36 @@ i80321_pci_init(pci_chipset_tag_t pc, vo
100 * to support how the busses are arranged on this chip. We also 100 * to support how the busses are arranged on this chip. We also
101 * need to only configure devices in the private device space on 101 * need to only configure devices in the private device space on
102 * the Secondary bus. 102 * the Secondary bus.
103 */ 103 */
104 104
105 busno = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, ATU_PCIXSR); 105 busno = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, ATU_PCIXSR);
106 busno = PCIXSR_BUSNO(busno); 106 busno = PCIXSR_BUSNO(busno);
107 if (busno == 0xff) 107 if (busno == 0xff)
108 busno = 0; 108 busno = 0;
109 109
110 ioext = extent_create("pciio", 110 ioext = extent_create("pciio",
111 sc->sc_ioout_xlate + sc->sc_ioout_xlate_offset, 111 sc->sc_ioout_xlate + sc->sc_ioout_xlate_offset,
112 sc->sc_ioout_xlate + VERDE_OUT_XLATE_IO_WIN_SIZE - 1, 112 sc->sc_ioout_xlate + VERDE_OUT_XLATE_IO_WIN_SIZE - 1,
113 M_DEVBUF, NULL, 0, EX_NOWAIT); 113 NULL, 0, EX_NOWAIT);
114 114
115#ifdef I80321_USE_DIRECT_WIN 115#ifdef I80321_USE_DIRECT_WIN
116 memext = extent_create("pcimem", VERDE_OUT_DIRECT_WIN_BASE + VERDE_OUT_DIRECT_WIN_SKIP, 116 memext = extent_create("pcimem", VERDE_OUT_DIRECT_WIN_BASE + VERDE_OUT_DIRECT_WIN_SKIP,
117 VERDE_OUT_DIRECT_WIN_BASE + VERDE_OUT_DIRECT_WIN_SIZE- 1, 117 VERDE_OUT_DIRECT_WIN_BASE + VERDE_OUT_DIRECT_WIN_SIZE- 1,
118 M_DEVBUF, NULL, 0, EX_NOWAIT); 118 NULL, 0, EX_NOWAIT);
119#else 119#else
120 memext = extent_create("pcimem", sc->sc_owin[0].owin_xlate_lo, 120 memext = extent_create("pcimem", sc->sc_owin[0].owin_xlate_lo,
121 sc->sc_owin[0].owin_xlate_lo + VERDE_OUT_XLATE_MEM_WIN_SIZE - 1, 121 sc->sc_owin[0].owin_xlate_lo + VERDE_OUT_XLATE_MEM_WIN_SIZE - 1,
122 M_DEVBUF, NULL, 0, EX_NOWAIT); 122 NULL, 0, EX_NOWAIT);
123#endif 123#endif
124 124
125 aprint_normal("%s: configuring PCI bus\n", sc->sc_dev.dv_xname); 125 aprint_normal("%s: configuring PCI bus\n", sc->sc_dev.dv_xname);
126 pci_configure_bus(pc, ioext, memext, NULL, busno, arm_dcache_align); 126 pci_configure_bus(pc, ioext, memext, NULL, busno, arm_dcache_align);
127 127
128 extent_destroy(ioext); 128 extent_destroy(ioext);
129 extent_destroy(memext); 129 extent_destroy(memext);
130#endif 130#endif
131} 131}
132 132
133void 133void
134pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p) 134pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p)
135{ 135{

cvs diff -r1.7 -r1.8 src/sys/arch/arm/xscale/ixp425_pci.c (expand / switch to unified diff)

--- src/sys/arch/arm/xscale/ixp425_pci.c 2011/07/01 20:32:51 1.7
+++ src/sys/arch/arm/xscale/ixp425_pci.c 2012/01/27 18:52:51 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ixp425_pci.c,v 1.7 2011/07/01 20:32:51 dyoung Exp $ */ 1/* $NetBSD: ixp425_pci.c,v 1.8 2012/01/27 18:52:51 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 4 * Copyright (c) 2003
5 * Ichiro FUKUHARA <ichiro@ichiro.org>. 5 * Ichiro FUKUHARA <ichiro@ichiro.org>.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -18,27 +18,27 @@ @@ -18,27 +18,27 @@
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR 20 * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * LIABILITY, 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 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30#include <sys/cdefs.h> 30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: ixp425_pci.c,v 1.7 2011/07/01 20:32:51 dyoung Exp $"); 31__KERNEL_RCSID(0, "$NetBSD: ixp425_pci.c,v 1.8 2012/01/27 18:52:51 para Exp $");
32 32
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/extent.h> 36#include <sys/extent.h>
37#include <sys/malloc.h> 37#include <sys/malloc.h>
38 38
39#include <uvm/uvm_extern.h> 39#include <uvm/uvm_extern.h>
40 40
41#include <sys/bus.h> 41#include <sys/bus.h>
42 42
43#include <arm/xscale/ixp425reg.h> 43#include <arm/xscale/ixp425reg.h>
44#include <arm/xscale/ixp425var.h> 44#include <arm/xscale/ixp425var.h>
@@ -79,32 +79,32 @@ ixp425_pci_init(struct ixp425_softc *sc) @@ -79,32 +79,32 @@ ixp425_pci_init(struct ixp425_softc *sc)
79 pc->pc_make_tag = ixp425_pci_make_tag; 79 pc->pc_make_tag = ixp425_pci_make_tag;
80 pc->pc_decompose_tag = ixp425_pci_decompose_tag; 80 pc->pc_decompose_tag = ixp425_pci_decompose_tag;
81 pc->pc_conf_read = ixp425_pci_conf_read; 81 pc->pc_conf_read = ixp425_pci_conf_read;
82 pc->pc_conf_write = ixp425_pci_conf_write; 82 pc->pc_conf_write = ixp425_pci_conf_write;
83 83
84 /* 84 /*
85 * Initialize the bus space tags. 85 * Initialize the bus space tags.
86 */ 86 */
87 ixp425_io_bs_init(&sc->sc_pci_iot, sc); 87 ixp425_io_bs_init(&sc->sc_pci_iot, sc);
88 ixp425_mem_bs_init(&sc->sc_pci_memt, sc); 88 ixp425_mem_bs_init(&sc->sc_pci_memt, sc);
89 89
90#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE) 90#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE)
91 ioext = extent_create("pciio", 0, IXP425_PCI_IO_SIZE - 1, 91 ioext = extent_create("pciio", 0, IXP425_PCI_IO_SIZE - 1,
92 M_DEVBUF, NULL, 0, EX_NOWAIT); 92 NULL, 0, EX_NOWAIT);
93 /* PCI MEM space is mapped same address as real memory */ 93 /* PCI MEM space is mapped same address as real memory */
94 memext = extent_create("pcimem", IXP425_PCI_MEM_HWBASE, 94 memext = extent_create("pcimem", IXP425_PCI_MEM_HWBASE,
95 IXP425_PCI_MEM_HWBASE + 95 IXP425_PCI_MEM_HWBASE +
96 IXP425_PCI_MEM_SIZE - 1, 96 IXP425_PCI_MEM_SIZE - 1,
97 M_DEVBUF, NULL, 0, EX_NOWAIT); 97 NULL, 0, EX_NOWAIT);
98 printf("%s: configuring PCI bus\n", sc->sc_dev.dv_xname); 98 printf("%s: configuring PCI bus\n", sc->sc_dev.dv_xname);
99 pci_configure_bus(pc, ioext, memext, NULL, 0 /* XXX bus = 0 */, 99 pci_configure_bus(pc, ioext, memext, NULL, 0 /* XXX bus = 0 */,
100 arm_dcache_align); 100 arm_dcache_align);
101 101
102 extent_destroy(ioext); 102 extent_destroy(ioext);
103 extent_destroy(memext); 103 extent_destroy(memext);
104#endif 104#endif
105} 105}
106 106
107void 107void
108pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p) 108pci_conf_interrupt(pci_chipset_tag_t pc, int a, int b, int c, int d, int *p)
109{ 109{
110} 110}

cvs diff -r1.96 -r1.97 src/sys/arch/atari/atari/atari_init.c (expand / switch to unified diff)

--- src/sys/arch/atari/atari/atari_init.c 2011/11/26 14:05:52 1.96
+++ src/sys/arch/atari/atari/atari_init.c 2012/01/27 18:52:52 1.97
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: atari_init.c,v 1.96 2011/11/26 14:05:52 tsutsui Exp $ */ 1/* $NetBSD: atari_init.c,v 1.97 2012/01/27 18:52:52 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 Leo Weppelman 4 * Copyright (c) 1995 Leo Weppelman
5 * Copyright (c) 1994 Michael L. Hitch 5 * Copyright (c) 1994 Michael L. Hitch
6 * Copyright (c) 1993 Markus Wild 6 * Copyright (c) 1993 Markus Wild
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.96 2011/11/26 14:05:52 tsutsui Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.97 2012/01/27 18:52:52 para Exp $");
37 37
38#include "opt_ddb.h" 38#include "opt_ddb.h"
39#include "opt_mbtype.h" 39#include "opt_mbtype.h"
40#include "opt_m060sp.h" 40#include "opt_m060sp.h"
41#include "opt_m68k_arch.h" 41#include "opt_m68k_arch.h"
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/ioctl.h> 45#include <sys/ioctl.h>
46#include <sys/select.h> 46#include <sys/select.h>
47#include <sys/tty.h> 47#include <sys/tty.h>
48#include <sys/buf.h> 48#include <sys/buf.h>
49#include <sys/msgbuf.h> 49#include <sys/msgbuf.h>
@@ -578,27 +578,27 @@ start_c(int id, u_int ttphystart, u_int  @@ -578,27 +578,27 @@ start_c(int id, u_int ttphystart, u_int
578 */ 578 */
579 init_stmem(); 579 init_stmem();
580 580
581 /* 581 /*
582 * Initialize the I/O mem extent map. 582 * Initialize the I/O mem extent map.
583 * Note: we don't have to check the return value since 583 * Note: we don't have to check the return value since
584 * creation of a fixed extent map will never fail (since 584 * creation of a fixed extent map will never fail (since
585 * descriptor storage has already been allocated). 585 * descriptor storage has already been allocated).
586 * 586 *
587 * N.B. The iomem extent manages _all_ physical addresses 587 * N.B. The iomem extent manages _all_ physical addresses
588 * on the machine. When the amount of RAM is found, all 588 * on the machine. When the amount of RAM is found, all
589 * extents of RAM are allocated from the map. 589 * extents of RAM are allocated from the map.
590 */ 590 */
591 iomem_ex = extent_create("iomem", 0x0, 0xffffffff, M_DEVBUF, 591 iomem_ex = extent_create("iomem", 0x0, 0xffffffff,
592 (void *)iomem_ex_storage, sizeof(iomem_ex_storage), 592 (void *)iomem_ex_storage, sizeof(iomem_ex_storage),
593 EX_NOCOALESCE|EX_NOWAIT); 593 EX_NOCOALESCE|EX_NOWAIT);
594 594
595 /* 595 /*
596 * Allocate the physical RAM from the extent map 596 * Allocate the physical RAM from the extent map
597 */ 597 */
598 for (i = 0; boot_segs[i].end != 0; i++) { 598 for (i = 0; boot_segs[i].end != 0; i++) {
599 if (extent_alloc_region(iomem_ex, boot_segs[i].start, 599 if (extent_alloc_region(iomem_ex, boot_segs[i].start,
600 boot_segs[i].end - boot_segs[i].start, EX_NOWAIT)) { 600 boot_segs[i].end - boot_segs[i].start, EX_NOWAIT)) {
601 /* XXX: Ahum, should not happen ;-) */ 601 /* XXX: Ahum, should not happen ;-) */
602 printf("Warning: Cannot allocate boot memory from" 602 printf("Warning: Cannot allocate boot memory from"
603 " extent map!?\n"); 603 " extent map!?\n");
604 } 604 }

cvs diff -r1.56 -r1.57 src/sys/arch/atari/atari/bus.c (expand / switch to unified diff)

--- src/sys/arch/atari/atari/bus.c 2011/07/01 20:34:05 1.56
+++ src/sys/arch/atari/atari/bus.c 2012/01/27 18:52:52 1.57
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus.c,v 1.56 2011/07/01 20:34:05 dyoung Exp $ */ 1/* $NetBSD: bus.c,v 1.57 2012/01/27 18:52:52 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center and by Chris G. Demetriou. 9 * NASA Ames Research Center and by Chris G. Demetriou.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include "opt_m68k_arch.h" 33#include "opt_m68k_arch.h"
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.56 2011/07/01 20:34:05 dyoung Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.57 2012/01/27 18:52:52 para Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/extent.h> 40#include <sys/extent.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/mbuf.h> 42#include <sys/mbuf.h>
43#include <sys/proc.h> 43#include <sys/proc.h>
44 44
45#include <uvm/uvm.h> 45#include <uvm/uvm.h>
46 46
47#include <machine/cpu.h> 47#include <machine/cpu.h>
48#include <m68k/cacheops.h> 48#include <m68k/cacheops.h>
49#define _ATARI_BUS_DMA_PRIVATE 49#define _ATARI_BUS_DMA_PRIVATE
@@ -76,27 +76,27 @@ extern paddr_t avail_end; @@ -76,27 +76,27 @@ extern paddr_t avail_end;
76 */ 76 */
77static pt_entry_t *bootm_ptep; 77static pt_entry_t *bootm_ptep;
78static long bootm_ex_storage[EXTENT_FIXED_STORAGE_SIZE(32) / 78static long bootm_ex_storage[EXTENT_FIXED_STORAGE_SIZE(32) /
79 sizeof(long)]; 79 sizeof(long)];
80static struct extent *bootm_ex; 80static struct extent *bootm_ex;
81 81
82void bootm_init(vaddr_t, pt_entry_t *, u_long); 82void bootm_init(vaddr_t, pt_entry_t *, u_long);
83static vaddr_t bootm_alloc(paddr_t pa, u_long size, int flags); 83static vaddr_t bootm_alloc(paddr_t pa, u_long size, int flags);
84static int bootm_free(vaddr_t va, u_long size); 84static int bootm_free(vaddr_t va, u_long size);
85 85
86void 86void
87bootm_init(vaddr_t va, pt_entry_t *ptep, u_long size) 87bootm_init(vaddr_t va, pt_entry_t *ptep, u_long size)
88{ 88{
89 bootm_ex = extent_create("bootmem", va, va + size, M_DEVBUF, 89 bootm_ex = extent_create("bootmem", va, va + size,
90 (void *)bootm_ex_storage, sizeof(bootm_ex_storage), 90 (void *)bootm_ex_storage, sizeof(bootm_ex_storage),
91 EX_NOCOALESCE|EX_NOWAIT); 91 EX_NOCOALESCE|EX_NOWAIT);
92 bootm_ptep = ptep; 92 bootm_ptep = ptep;
93} 93}
94 94
95vaddr_t 95vaddr_t
96bootm_alloc(paddr_t pa, u_long size, int flags) 96bootm_alloc(paddr_t pa, u_long size, int flags)
97{ 97{
98 pt_entry_t *pg, *epg; 98 pt_entry_t *pg, *epg;
99 pt_entry_t pg_proto; 99 pt_entry_t pg_proto;
100 vaddr_t va, rva; 100 vaddr_t va, rva;
101 101
102 if (extent_alloc(bootm_ex, size, PAGE_SIZE, 0, EX_NOWAIT, &rva)) { 102 if (extent_alloc(bootm_ex, size, PAGE_SIZE, 0, EX_NOWAIT, &rva)) {

cvs diff -r1.28 -r1.29 src/sys/arch/bebox/bebox/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/bebox/bebox/mainbus.c 2011/08/07 15:31:35 1.28
+++ src/sys/arch/bebox/bebox/mainbus.c 2012/01/27 18:52:52 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.28 2011/08/07 15:31:35 kiyohara Exp $ */ 1/* $NetBSD: mainbus.c,v 1.29 2012/01/27 18:52:52 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.28 2011/08/07 15:31:35 kiyohara Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.29 2012/01/27 18:52:52 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/extent.h> 37#include <sys/extent.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41 41
42#include <machine/autoconf.h> 42#include <machine/autoconf.h>
43#include <sys/bus.h> 43#include <sys/bus.h>
44 44
45#include "pci.h" 45#include "pci.h"
46#include "opt_pci.h" 46#include "opt_pci.h"
47#include <dev/pci/pcivar.h> 47#include <dev/pci/pcivar.h>
@@ -125,29 +125,29 @@ mainbus_attach(device_t parent, device_t @@ -125,29 +125,29 @@ mainbus_attach(device_t parent, device_t
125 KASSERT(genppc_pct != NULL); 125 KASSERT(genppc_pct != NULL);
126 bebox_pci_get_chipset_tag(genppc_pct); 126 bebox_pci_get_chipset_tag(genppc_pct);
127 127
128 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), 128 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
129 M_DEVBUF, M_NOWAIT); 129 M_DEVBUF, M_NOWAIT);
130 KASSERT(pbi != NULL); 130 KASSERT(pbi != NULL);
131 pbi->pbi_properties = prop_dictionary_create(); 131 pbi->pbi_properties = prop_dictionary_create();
132 KASSERT(pbi->pbi_properties != NULL); 132 KASSERT(pbi->pbi_properties != NULL);
133 133
134 SIMPLEQ_INIT(&genppc_pct->pc_pbi); 134 SIMPLEQ_INIT(&genppc_pct->pc_pbi);
135 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next); 135 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next);
136 136
137#ifdef PCI_NETBSD_CONFIGURE 137#ifdef PCI_NETBSD_CONFIGURE
138 ioext = extent_create("pciio", 0x00008000, 0x0000ffff, M_DEVBUF, 138 ioext = extent_create("pciio", 0x00008000, 0x0000ffff,
139 NULL, 0, EX_NOWAIT); 139 NULL, 0, EX_NOWAIT);
140 memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF, 140 memext = extent_create("pcimem", 0x00000000, 0x0fffffff,
141 NULL, 0, EX_NOWAIT); 141 NULL, 0, EX_NOWAIT);
142 142
143 pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE); 143 pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE);
144 144
145 extent_destroy(ioext); 145 extent_destroy(ioext);
146 extent_destroy(memext); 146 extent_destroy(memext);
147#endif /* PCI_NETBSD_CONFIGURE */ 147#endif /* PCI_NETBSD_CONFIGURE */
148#endif /* NPCI */ 148#endif /* NPCI */
149 149
150#if NPCI > 0 150#if NPCI > 0
151 memset(&mba, 0, sizeof(mba)); 151 memset(&mba, 0, sizeof(mba));
152 mba.mba_pba.pba_iot = &prep_io_space_tag; 152 mba.mba_pba.pba_iot = &prep_io_space_tag;
153 mba.mba_pba.pba_memt = &prep_mem_space_tag; 153 mba.mba_pba.pba_memt = &prep_mem_space_tag;

cvs diff -r1.27 -r1.28 src/sys/arch/cobalt/dev/gt.c (expand / switch to unified diff)

--- src/sys/arch/cobalt/dev/gt.c 2011/07/09 16:09:01 1.27
+++ src/sys/arch/cobalt/dev/gt.c 2012/01/27 18:52:52 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gt.c,v 1.27 2011/07/09 16:09:01 matt Exp $ */ 1/* $NetBSD: gt.c,v 1.28 2012/01/27 18:52:52 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. 4 * Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer. 10 * notice, this list of conditions, and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * LIABILITY, 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 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE. 25 * SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.27 2011/07/09 16:09:01 matt Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.28 2012/01/27 18:52:52 para Exp $");
30 30
31#include "opt_pci.h" 31#include "opt_pci.h"
32#include "pci.h" 32#include "pci.h"
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/bus.h> 35#include <sys/bus.h>
36#include <sys/conf.h> 36#include <sys/conf.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/extent.h> 38#include <sys/extent.h>
39#include <sys/file.h> 39#include <sys/file.h>
40#include <sys/intr.h> 40#include <sys/intr.h>
41#include <sys/ioctl.h> 41#include <sys/ioctl.h>
42#include <sys/kernel.h> 42#include <sys/kernel.h>
@@ -116,29 +116,29 @@ gt_attach(device_t parent, device_t self @@ -116,29 +116,29 @@ gt_attach(device_t parent, device_t self
116 ~PCI_SYNCMODE) | PCI_PCLK_HIGH); 116 ~PCI_SYNCMODE) | PCI_PCLK_HIGH);
117 117
118 (void)bus_space_read_4(sc->sc_bst, sc->sc_bsh, GT_PCI_TIMEOUT_RETRY); 118 (void)bus_space_read_4(sc->sc_bst, sc->sc_bsh, GT_PCI_TIMEOUT_RETRY);
119 bus_space_write_4(sc->sc_bst, sc->sc_bsh, GT_PCI_TIMEOUT_RETRY, 119 bus_space_write_4(sc->sc_bst, sc->sc_bsh, GT_PCI_TIMEOUT_RETRY,
120 0x00 << PCI_RETRYCTR_SHIFT | 0xff << PCI_TIMEOUT1_SHIFT | 0xff); 120 0x00 << PCI_RETRYCTR_SHIFT | 0xff << PCI_TIMEOUT1_SHIFT | 0xff);
121 121
122#if NPCI > 0 122#if NPCI > 0
123 pc = &sc->sc_pc; 123 pc = &sc->sc_pc;
124 pc->pc_bst = sc->sc_bst; 124 pc->pc_bst = sc->sc_bst;
125 pc->pc_bsh = sc->sc_bsh; 125 pc->pc_bsh = sc->sc_bsh;
126 126
127#ifdef PCI_NETBSD_CONFIGURE 127#ifdef PCI_NETBSD_CONFIGURE
128 pc->pc_ioext = extent_create("pciio", 0x10001000, 0x11ffffff, 128 pc->pc_ioext = extent_create("pciio", 0x10001000, 0x11ffffff,
129 M_DEVBUF, NULL, 0, EX_NOWAIT); 129 NULL, 0, EX_NOWAIT);
130 pc->pc_memext = extent_create("pcimem", 0x12000000, 0x13ffffff, 130 pc->pc_memext = extent_create("pcimem", 0x12000000, 0x13ffffff,
131 M_DEVBUF, NULL, 0, EX_NOWAIT); 131 NULL, 0, EX_NOWAIT);
132 pci_configure_bus(pc, pc->pc_ioext, pc->pc_memext, NULL, 0, 132 pci_configure_bus(pc, pc->pc_ioext, pc->pc_memext, NULL, 0,
133 mips_cache_info.mci_dcache_align); 133 mips_cache_info.mci_dcache_align);
134#endif 134#endif
135 pba.pba_dmat = &pci_bus_dma_tag; 135 pba.pba_dmat = &pci_bus_dma_tag;
136 pba.pba_dmat64 = NULL; 136 pba.pba_dmat64 = NULL;
137 pba.pba_bus = 0; 137 pba.pba_bus = 0;
138 pba.pba_bridgetag = NULL; 138 pba.pba_bridgetag = NULL;
139 pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY | 139 pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
140 PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY; 140 PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY;
141 pba.pba_pc = pc; 141 pba.pba_pc = pc;
142 config_found_ia(self, "pcibus", &pba, gt_print); 142 config_found_ia(self, "pcibus", &pba, gt_print);
143#endif 143#endif
144} 144}

cvs diff -r1.19 -r1.20 src/sys/arch/dreamcast/dev/g2/gapspci_dma.c (expand / switch to unified diff)

--- src/sys/arch/dreamcast/dev/g2/gapspci_dma.c 2011/07/19 15:52:29 1.19
+++ src/sys/arch/dreamcast/dev/g2/gapspci_dma.c 2012/01/27 18:52:53 1.20
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gapspci_dma.c,v 1.19 2011/07/19 15:52:29 dyoung Exp $ */ 1/* $NetBSD: gapspci_dma.c,v 1.20 2012/01/27 18:52:53 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Bus DMA implementation for the SEGA GAPS PCI bridge. 33 * Bus DMA implementation for the SEGA GAPS PCI bridge.
34 * 34 *
35 * NOTE: We only implement a small subset of what the bus_space(9) 35 * NOTE: We only implement a small subset of what the bus_space(9)
36 * API specifies. Right now, the GAPS PCI bridge is only used for 36 * API specifies. Right now, the GAPS PCI bridge is only used for
37 * the Dreamcast Broadband Adatper, so we only provide what the 37 * the Dreamcast Broadband Adatper, so we only provide what the
38 * pci(4) and rtk(4) drivers need. 38 * pci(4) and rtk(4) drivers need.
39 */ 39 */
40 40
41#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ 41#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
42__KERNEL_RCSID(0, "$NetBSD: gapspci_dma.c,v 1.19 2011/07/19 15:52:29 dyoung Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: gapspci_dma.c,v 1.20 2012/01/27 18:52:53 para Exp $");
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/mbuf.h> 47#include <sys/mbuf.h>
48#include <sys/extent.h> 48#include <sys/extent.h>
49#include <sys/malloc.h> 49#include <sys/malloc.h>
50#include <sys/bus.h> 50#include <sys/bus.h>
51 51
52#include <machine/cpu.h> 52#include <machine/cpu.h>
53 53
54#include <dev/pci/pcivar.h> 54#include <dev/pci/pcivar.h>
55 55
@@ -99,27 +99,27 @@ gaps_dma_init(struct gaps_softc *sc) @@ -99,27 +99,27 @@ gaps_dma_init(struct gaps_softc *sc)
99 99
100 t->_dmamem_alloc = gaps_dmamem_alloc; 100 t->_dmamem_alloc = gaps_dmamem_alloc;
101 t->_dmamem_free = gaps_dmamem_free; 101 t->_dmamem_free = gaps_dmamem_free;
102 t->_dmamem_map = gaps_dmamem_map; 102 t->_dmamem_map = gaps_dmamem_map;
103 t->_dmamem_unmap = gaps_dmamem_unmap; 103 t->_dmamem_unmap = gaps_dmamem_unmap;
104 t->_dmamem_mmap = gaps_dmamem_mmap; 104 t->_dmamem_mmap = gaps_dmamem_mmap;
105 105
106 /* 106 /*
107 * The GAPS PCI bridge has 32k of DMA memory. We manage it 107 * The GAPS PCI bridge has 32k of DMA memory. We manage it
108 * with an extent map. 108 * with an extent map.
109 */ 109 */
110 sc->sc_dma_ex = extent_create("gaps dma", 110 sc->sc_dma_ex = extent_create("gaps dma",
111 sc->sc_dmabase, sc->sc_dmabase + (sc->sc_dmasize - 1), 111 sc->sc_dmabase, sc->sc_dmabase + (sc->sc_dmasize - 1),
112 M_DEVBUF, NULL, 0, EX_WAITOK | EXF_NOCOALESCE); 112 NULL, 0, EX_WAITOK | EXF_NOCOALESCE);
113 113
114 if (bus_space_map(sc->sc_memt, sc->sc_dmabase, sc->sc_dmasize, 114 if (bus_space_map(sc->sc_memt, sc->sc_dmabase, sc->sc_dmasize,
115 0, &sc->sc_dma_memh) != 0) 115 0, &sc->sc_dma_memh) != 0)
116 panic("gaps_dma_init: can't map SRAM buffer"); 116 panic("gaps_dma_init: can't map SRAM buffer");
117} 117}
118 118
119/* 119/*
120 * A GAPS DMA map -- has the standard DMA map, plus some extra 120 * A GAPS DMA map -- has the standard DMA map, plus some extra
121 * housekeeping data. 121 * housekeeping data.
122 */ 122 */
123struct gaps_dmamap { 123struct gaps_dmamap {
124 struct dreamcast_bus_dmamap gd_dmamap; 124 struct dreamcast_bus_dmamap gd_dmamap;
125 void *gd_origbuf; 125 void *gd_origbuf;

cvs diff -r1.5 -r1.6 src/sys/arch/emips/emips/machdep.c (expand / switch to unified diff)

--- src/sys/arch/emips/emips/machdep.c 2011/06/12 03:21:21 1.5
+++ src/sys/arch/emips/emips/machdep.c 2012/01/27 18:52:53 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $ */ 1/* $NetBSD: machdep.c,v 1.6 2012/01/27 18:52:53 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1992, 1993 5 * Copyright (c) 1992, 1993
6 * The Regents of the University of California. All rights reserved. 6 * The Regents of the University of California. All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department, The Mach Operating System project at 10 * Science Department, The Mach Operating System project at
11 * Carnegie-Mellon University and Ralph Campbell. 11 * Carnegie-Mellon University and Ralph Campbell.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE. 35 * SUCH DAMAGE.
36 * 36 *
37 * @(#)machdep.c 8.3 (Berkeley) 1/12/94 37 * @(#)machdep.c 8.3 (Berkeley) 1/12/94
38 * from: Utah Hdr: machdep.c 1.63 91/04/24 38 * from: Utah Hdr: machdep.c 1.63 91/04/24
39 */ 39 */
40 40
41#include <sys/cdefs.h> 41#include <sys/cdefs.h>
42__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2011/06/12 03:21:21 tsutsui Exp $"); 42__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.6 2012/01/27 18:52:53 para Exp $");
43 43
44#include "opt_ddb.h" 44#include "opt_ddb.h"
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/extent.h> 48#include <sys/extent.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/buf.h> 50#include <sys/buf.h>
51#include <sys/mbuf.h> 51#include <sys/mbuf.h>
52#include <sys/reboot.h> 52#include <sys/reboot.h>
53#include <sys/mount.h> 53#include <sys/mount.h>
54#include <sys/kcore.h> 54#include <sys/kcore.h>
55#include <sys/boot_flag.h> 55#include <sys/boot_flag.h>
@@ -328,27 +328,27 @@ void @@ -328,27 +328,27 @@ void
328mips_machdep_cache_config(void) 328mips_machdep_cache_config(void)
329{ 329{
330} 330}
331 331
332void 332void
333consinit(void) 333consinit(void)
334{ 334{
335 /* 335 /*
336 * Init I/O memory extent map. Must be done before cninit() 336 * Init I/O memory extent map. Must be done before cninit()
337 * is called; we may want to use iospace in the console routines. 337 * is called; we may want to use iospace in the console routines.
338 */ 338 */
339 KASSERT(iospace != 0); 339 KASSERT(iospace != 0);
340 iomap_ex = extent_create("iomap", iospace, 340 iomap_ex = extent_create("iomap", iospace,
341 iospace + iospace_size - 1, M_DEVBUF, 341 iospace + iospace_size - 1,
342 (void *) iomap_ex_storage, sizeof(iomap_ex_storage), 342 (void *) iomap_ex_storage, sizeof(iomap_ex_storage),
343 EX_NOCOALESCE|EX_NOWAIT); 343 EX_NOCOALESCE|EX_NOWAIT);
344 344
345 /* 345 /*
346 * Up until now we have kept the TLB disabled, 346 * Up until now we have kept the TLB disabled,
347 * and that allowed the "PROM" to work. 347 * and that allowed the "PROM" to work.
348 * Specifically, romputc() and the debugger's getc() functions worked. 348 * Specifically, romputc() and the debugger's getc() functions worked.
349 * Now is the last chance we get to turn it on. 349 * Now is the last chance we get to turn it on.
350 * That means no more console I/O until autoconf() [sigh!], or.. 350 * That means no more console I/O until autoconf() [sigh!], or..
351 * The platform-specific code will have to map [1:1 probably] 351 * The platform-specific code will have to map [1:1 probably]
352 * the I/O registers. 352 * the I/O registers.
353 */ 353 */
354 register_t s = mips_cp0_status_read(); 354 register_t s = mips_cp0_status_read();

cvs diff -r1.24 -r1.25 src/sys/arch/evbarm/ifpga/ifpga.c (expand / switch to unified diff)

--- src/sys/arch/evbarm/ifpga/ifpga.c 2011/05/17 17:34:49 1.24
+++ src/sys/arch/evbarm/ifpga/ifpga.c 2012/01/27 18:52:53 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ifpga.c,v 1.24 2011/05/17 17:34:49 dyoung Exp $ */ 1/* $NetBSD: ifpga.c,v 1.25 2012/01/27 18:52:53 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 ARM Ltd 4 * Copyright (c) 2001 ARM Ltd
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Integrator FPGA core logic support. 33 * Integrator FPGA core logic support.
34 * 34 *
35 * The integrator board supports the core logic in an FPGA which is loaded 35 * The integrator board supports the core logic in an FPGA which is loaded
36 * at POR with a custom design. This code supports the default logic as the 36 * at POR with a custom design. This code supports the default logic as the
37 * board is shipped. 37 * board is shipped.
38 */ 38 */
39 39
40#include <sys/cdefs.h> 40#include <sys/cdefs.h>
41__KERNEL_RCSID(0, "$NetBSD: ifpga.c,v 1.24 2011/05/17 17:34:49 dyoung Exp $"); 41__KERNEL_RCSID(0, "$NetBSD: ifpga.c,v 1.25 2012/01/27 18:52:53 para Exp $");
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/types.h> 44#include <sys/types.h>
45#include <sys/device.h> 45#include <sys/device.h>
46#include <sys/systm.h> 46#include <sys/systm.h>
47#include <sys/extent.h> 47#include <sys/extent.h>
48#include <sys/malloc.h> 48#include <sys/malloc.h>
49#include <sys/null.h> 49#include <sys/null.h>
50 50
51#include <dev/pci/pcivar.h> 51#include <dev/pci/pcivar.h>
52#include <dev/pci/pciconf.h> 52#include <dev/pci/pciconf.h>
53 53
54#include <arm/cpufunc.h> 54#include <arm/cpufunc.h>
@@ -286,33 +286,33 @@ ifpga_attach(device_t parent, device_t s @@ -286,33 +286,33 @@ ifpga_attach(device_t parent, device_t s
286 char buf[1000]; 286 char buf[1000];
287 287
288 id_reg = bus_space_read_4(pci_sc->sc_memt, pci_sc->sc_reg_ioh, 288 id_reg = bus_space_read_4(pci_sc->sc_memt, pci_sc->sc_reg_ioh,
289 V360_PCI_VENDOR); 289 V360_PCI_VENDOR);
290 class_reg = bus_space_read_4(pci_sc->sc_memt, 290 class_reg = bus_space_read_4(pci_sc->sc_memt,
291 pci_sc->sc_reg_ioh, V360_PCI_CC_REV); 291 pci_sc->sc_reg_ioh, V360_PCI_CC_REV);
292 292
293 pci_devinfo(id_reg, class_reg, 1, buf, sizeof(buf)); 293 pci_devinfo(id_reg, class_reg, 1, buf, sizeof(buf));
294 printf("%s: %s\n", device_xname(self), buf); 294 printf("%s: %s\n", device_xname(self), buf);
295 } 295 }
296 296
297#if defined(PCI_NETBSD_CONFIGURE) 297#if defined(PCI_NETBSD_CONFIGURE)
298 ioext = extent_create("pciio", 0x00000000, 298 ioext = extent_create("pciio", 0x00000000,
299 0x00000000 + IFPGA_PCI_IO_VSIZE, M_DEVBUF, NULL, 0, EX_NOWAIT); 299 0x00000000 + IFPGA_PCI_IO_VSIZE, NULL, 0, EX_NOWAIT);
300 memext = extent_create("pcimem", IFPGA_PCI_APP0_BASE, 300 memext = extent_create("pcimem", IFPGA_PCI_APP0_BASE,
301 IFPGA_PCI_APP0_BASE + IFPGA_PCI_APP0_SIZE, 301 IFPGA_PCI_APP0_BASE + IFPGA_PCI_APP0_SIZE,
302 M_DEVBUF, NULL, 0, EX_NOWAIT); 302 NULL, 0, EX_NOWAIT);
303 pmemext = extent_create("pcipmem", IFPGA_PCI_APP1_BASE, 303 pmemext = extent_create("pcipmem", IFPGA_PCI_APP1_BASE,
304 IFPGA_PCI_APP1_BASE + IFPGA_PCI_APP1_SIZE, 304 IFPGA_PCI_APP1_BASE + IFPGA_PCI_APP1_SIZE,
305 M_DEVBUF, NULL, 0, EX_NOWAIT); 305 NULL, 0, EX_NOWAIT);
306 ifpga_pci_chipset.pc_conf_v = (void *)pci_sc; 306 ifpga_pci_chipset.pc_conf_v = (void *)pci_sc;
307 pci_configure_bus(&ifpga_pci_chipset, ioext, memext, pmemext, 0, 307 pci_configure_bus(&ifpga_pci_chipset, ioext, memext, pmemext, 0,
308 arm_dcache_align); 308 arm_dcache_align);
309 extent_destroy(pmemext); 309 extent_destroy(pmemext);
310 extent_destroy(memext); 310 extent_destroy(memext);
311 extent_destroy(ioext); 311 extent_destroy(ioext);
312 312
313 printf("pci_configure_bus done\n"); 313 printf("pci_configure_bus done\n");
314#endif /* PCI_NETBSD_CONFIGURE */ 314#endif /* PCI_NETBSD_CONFIGURE */
315#endif /* NPCI > 0 */ 315#endif /* NPCI > 0 */
316 316
317 /* Finally, search for children. */ 317 /* Finally, search for children. */
318 config_search_ia(ifpga_search, self, "ifpga", NULL); 318 config_search_ia(ifpga_search, self, "ifpga", NULL);

cvs diff -r1.8 -r1.9 src/sys/arch/evbarm/tsarm/isa/isa_io.c (expand / switch to unified diff)

--- src/sys/arch/evbarm/tsarm/isa/isa_io.c 2011/07/01 19:11:34 1.8
+++ src/sys/arch/evbarm/tsarm/isa/isa_io.c 2012/01/27 18:52:54 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: isa_io.c,v 1.8 2011/07/01 19:11:34 dyoung Exp $ */ 1/* $NetBSD: isa_io.c,v 1.9 2012/01/27 18:52:54 para Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 4 * Copyright 1997
5 * Digital Equipment Corporation. All rights reserved. 5 * Digital Equipment Corporation. All rights reserved.
6 * 6 *
7 * This software is furnished under license and may be used and 7 * This software is furnished under license and may be used and
8 * copied only in accordance with the following terms and conditions. 8 * copied only in accordance with the following terms and conditions.
9 * Subject to these conditions, you may download, copy, install, 9 * Subject to these conditions, you may download, copy, install,
10 * use, modify and distribute this software in source and/or binary 10 * use, modify and distribute this software in source and/or binary
11 * form. No title or ownership is transferred hereby. 11 * form. No title or ownership is transferred hereby.
12 * 12 *
13 * 1) Any source code used, modified or distributed must reproduce 13 * 1) Any source code used, modified or distributed must reproduce
14 * and retain this copyright notice and list of conditions as 14 * and retain this copyright notice and list of conditions as
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * liable for any damages whatsoever, and in particular, DIGITAL 28 * liable for any damages whatsoever, and in particular, DIGITAL
29 * shall not be liable for special, indirect, consequential, or 29 * shall not be liable for special, indirect, consequential, or
30 * incidental damages or damages for lost profits, loss of 30 * incidental damages or damages for lost profits, loss of
31 * revenue or loss of use, whether such damages arise in contract, 31 * revenue or loss of use, whether such damages arise in contract,
32 * negligence, tort, under statute, in equity, at law or otherwise, 32 * negligence, tort, under statute, in equity, at law or otherwise,
33 * even if advised of the possibility of such damage. 33 * even if advised of the possibility of such damage.
34 */ 34 */
35 35
36/* 36/*
37 * bus_space I/O functions for isa 37 * bus_space I/O functions for isa
38 */ 38 */
39 39
40#include <sys/cdefs.h> 40#include <sys/cdefs.h>
41__KERNEL_RCSID(0, "$NetBSD: isa_io.c,v 1.8 2011/07/01 19:11:34 dyoung Exp $"); 41__KERNEL_RCSID(0, "$NetBSD: isa_io.c,v 1.9 2012/01/27 18:52:54 para Exp $");
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/malloc.h> 45#include <sys/malloc.h>
46#include <sys/extent.h> 46#include <sys/extent.h>
47#include <sys/bus.h> 47#include <sys/bus.h>
48#include <machine/pio.h> 48#include <machine/pio.h>
49#include <machine/isa_machdep.h> 49#include <machine/isa_machdep.h>
50 50
51/* Proto types for all the bus_space structure functions */ 51/* Proto types for all the bus_space structure functions */
52 52
53bs_protos(isa); 53bs_protos(isa);
54bs_protos(bs_notimpl); 54bs_protos(bs_notimpl);
@@ -232,30 +232,30 @@ void @@ -232,30 +232,30 @@ void
232isa_bs_mallocok(void) 232isa_bs_mallocok(void)
233{ 233{
234 malloc_safe = 1; 234 malloc_safe = 1;
235} 235}
236 236
237/* bus space functions */ 237/* bus space functions */
238 238
239void 239void
240isa_io_init(vm_offset_t isa_io_addr, vm_offset_t isa_mem_addr) 240isa_io_init(vm_offset_t isa_io_addr, vm_offset_t isa_mem_addr)
241{ 241{
242 isa_io_bs_tag.bs_cookie = (void *)isa_io_addr; 242 isa_io_bs_tag.bs_cookie = (void *)isa_io_addr;
243 isa_mem_bs_tag.bs_cookie = (void *)isa_mem_addr; 243 isa_mem_bs_tag.bs_cookie = (void *)isa_mem_addr;
244 244
245 isaio_ex = extent_create("isaio", 0x0, 0xffff, M_DEVBUF,  245 isaio_ex = extent_create("isaio", 0x0, 0xffff,
246 (void *)isaio_ex_storage, sizeof(isaio_ex_storage), 246 (void *)isaio_ex_storage, sizeof(isaio_ex_storage),
247 EX_NOWAIT|EX_NOCOALESCE); 247 EX_NOWAIT|EX_NOCOALESCE);
248 isamem_ex = extent_create("isamem", 0x0, 0xfffff, M_DEVBUF,  248 isamem_ex = extent_create("isamem", 0x0, 0xfffff,
249 (void *)isamem_ex_storage, sizeof(isamem_ex_storage), 249 (void *)isamem_ex_storage, sizeof(isamem_ex_storage),
250 EX_NOWAIT|EX_NOCOALESCE); 250 EX_NOWAIT|EX_NOCOALESCE);
251 if (isaio_ex == NULL || isamem_ex == NULL) 251 if (isaio_ex == NULL || isamem_ex == NULL)
252 panic("isa_io_init(): can't alloc extent maps"); 252 panic("isa_io_init(): can't alloc extent maps");
253} 253}
254 254
255/* 255/*
256 * break the abstraction: sometimes, other parts of the system 256 * break the abstraction: sometimes, other parts of the system
257 * (e.g. X servers) need to map ISA space directly. use these 257 * (e.g. X servers) need to map ISA space directly. use these
258 * functions sparingly! 258 * functions sparingly!
259 */ 259 */
260vm_offset_t 260vm_offset_t
261isa_io_data_vaddr(void) 261isa_io_data_vaddr(void)

cvs diff -r1.3 -r1.4 src/sys/arch/evbmips/gdium/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/evbmips/gdium/mainbus.c 2009/08/11 02:32:38 1.3
+++ src/sys/arch/evbmips/gdium/mainbus.c 2012/01/27 18:52:54 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.3 2009/08/11 02:32:38 matt Exp $ */ 1/* $NetBSD: mainbus.c,v 1.4 2012/01/27 18:52:54 para Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Wasabi Systems, Inc. 4 * Copyright 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Simon Burge for Wasabi Systems, Inc. 7 * Written by Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2009/08/11 02:32:38 matt Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2012/01/27 18:52:54 para Exp $");
40 40
41#include "opt_pci.h" 41#include "opt_pci.h"
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/device.h> 45#include <sys/device.h>
46#if defined(PCI_NETBSD_CONFIGURE) 46#if defined(PCI_NETBSD_CONFIGURE)
47#include <sys/extent.h> 47#include <sys/extent.h>
48#include <sys/malloc.h> 48#include <sys/malloc.h>
49#endif 49#endif
50 50
51#include <dev/pci/pcivar.h> 51#include <dev/pci/pcivar.h>
52#if defined(PCI_NETBSD_CONFIGURE) 52#if defined(PCI_NETBSD_CONFIGURE)
@@ -93,29 +93,29 @@ mainbus_match(device_t parent, cfdata_t  @@ -93,29 +93,29 @@ mainbus_match(device_t parent, cfdata_t
93static void 93static void
94mainbus_attach(device_t parent, device_t self, void *aux) 94mainbus_attach(device_t parent, device_t self, void *aux)
95{ 95{
96 size_t i; 96 size_t i;
97 97
98 mainbus_found = true; 98 mainbus_found = true;
99 aprint_normal("\n"); 99 aprint_normal("\n");
100 100
101#if defined(PCI_NETBSD_CONFIGURE) 101#if defined(PCI_NETBSD_CONFIGURE)
102 { 102 {
103 struct extent *ioext, *memext; 103 struct extent *ioext, *memext;
104 104
105 ioext = extent_create("pciio", 0x00001000, 0x00003fff, 105 ioext = extent_create("pciio", 0x00001000, 0x00003fff,
106 M_DEVBUF, NULL, 0, EX_NOWAIT); 106 NULL, 0, EX_NOWAIT);
107 memext = extent_create("pcimem", 0, BONITO_PCILO_SIZE, 107 memext = extent_create("pcimem", 0, BONITO_PCILO_SIZE,
108 M_DEVBUF, NULL, 0, EX_NOWAIT); 108 NULL, 0, EX_NOWAIT);
109 109
110 pci_configure_bus(&gdium_configuration.gc_pc, ioext, memext, 110 pci_configure_bus(&gdium_configuration.gc_pc, ioext, memext,
111 NULL, 0, mips_dcache_align); 111 NULL, 0, mips_dcache_align);
112 extent_destroy(ioext); 112 extent_destroy(ioext);
113 extent_destroy(memext); 113 extent_destroy(memext);
114 } 114 }
115#endif /* PCI_NETBSD_CONFIGURE */ 115#endif /* PCI_NETBSD_CONFIGURE */
116 116
117 for (i = 0; i < __arraycount(mainbusdevs); i++) { 117 for (i = 0; i < __arraycount(mainbusdevs); i++) {
118 struct mainbus_attach_args maa; 118 struct mainbus_attach_args maa;
119 maa.maa_name = mainbusdevs[i]; 119 maa.maa_name = mainbusdevs[i];
120 (void) config_found(self, &maa, mainbus_print); 120 (void) config_found(self, &maa, mainbus_print);
121 } 121 }

cvs diff -r1.9 -r1.10 src/sys/arch/evbmips/rmixl/machdep.c (expand / switch to unified diff)

--- src/sys/arch/evbmips/rmixl/machdep.c 2011/04/12 00:21:10 1.9
+++ src/sys/arch/evbmips/rmixl/machdep.c 2012/01/27 18:52:54 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.9 2011/04/12 00:21:10 matt Exp $ */ 1/* $NetBSD: machdep.c,v 1.10 2012/01/27 18:52:54 para Exp $ */
2 2
3/* 3/*
4 * Copyright 2001, 2002 Wasabi Systems, Inc. 4 * Copyright 2001, 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe and Simon Burge for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe and Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -64,27 +64,27 @@ @@ -64,27 +64,27 @@
64 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 64 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
65 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 65 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
66 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 66 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70 * SUCH DAMAGE. 70 * SUCH DAMAGE.
71 * 71 *
72 * @(#)machdep.c 8.3 (Berkeley) 1/12/94 72 * @(#)machdep.c 8.3 (Berkeley) 1/12/94
73 * from: Utah Hdr: machdep.c 1.63 91/04/24 73 * from: Utah Hdr: machdep.c 1.63 91/04/24
74 */ 74 */
75 75
76#include <sys/cdefs.h> 76#include <sys/cdefs.h>
77__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2011/04/12 00:21:10 matt Exp $"); 77__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2012/01/27 18:52:54 para Exp $");
78 78
79#define __INTR_PRIVATE 79#define __INTR_PRIVATE
80 80
81#include "opt_multiprocessor.h" 81#include "opt_multiprocessor.h"
82#include "opt_ddb.h" 82#include "opt_ddb.h"
83#include "opt_com.h" 83#include "opt_com.h"
84#include "opt_execfmt.h" 84#include "opt_execfmt.h"
85#include "opt_memsize.h" 85#include "opt_memsize.h"
86#include "rmixl_pcix.h" 86#include "rmixl_pcix.h"
87#include "rmixl_pcie.h" 87#include "rmixl_pcie.h"
88 88
89#include <sys/param.h> 89#include <sys/param.h>
90#include <sys/systm.h> 90#include <sys/systm.h>
@@ -601,27 +601,27 @@ ram_seg_resv(phys_ram_seg_t *segs, u_int @@ -601,27 +601,27 @@ ram_seg_resv(phys_ram_seg_t *segs, u_int
601 * what remains can be allocated as needed for other stuff 601 * what remains can be allocated as needed for other stuff
602 * e.g. to configure BARs that are not already initialized and enabled. 602 * e.g. to configure BARs that are not already initialized and enabled.
603 */ 603 */
604static void 604static void
605rmixl_physaddr_init(void) 605rmixl_physaddr_init(void)
606{ 606{
607 struct extent *ext; 607 struct extent *ext;
608 unsigned long start = 0UL; 608 unsigned long start = 0UL;
609 unsigned long end = (__BIT(40) / (1024 * 1024)) -1; 609 unsigned long end = (__BIT(40) / (1024 * 1024)) -1;
610 u_long base; 610 u_long base;
611 u_long size; 611 u_long size;
612 uint32_t r; 612 uint32_t r;
613 613
614 ext = extent_create("physaddr", start, end, M_DEVBUF, 614 ext = extent_create("physaddr", start, end,
615 (void *)rmixl_physaddr_storage, sizeof(rmixl_physaddr_storage), 615 (void *)rmixl_physaddr_storage, sizeof(rmixl_physaddr_storage),
616 EX_NOWAIT | EX_NOCOALESCE); 616 EX_NOWAIT | EX_NOCOALESCE);
617 617
618 if (ext == NULL) 618 if (ext == NULL)
619 panic("%s: extent_create failed", __func__); 619 panic("%s: extent_create failed", __func__);
620 620
621 /* 621 /*
622 * grab regions per DRAM BARs 622 * grab regions per DRAM BARs
623 */ 623 */
624 for (u_int i=0; i < RMIXL_SBC_DRAM_NBARS; i++) {  624 for (u_int i=0; i < RMIXL_SBC_DRAM_NBARS; i++) {
625 r = RMIXL_IOREG_READ(RMIXL_SBC_DRAM_BAR(i)); 625 r = RMIXL_IOREG_READ(RMIXL_SBC_DRAM_BAR(i));
626 if ((r & RMIXL_DRAM_BAR_STATUS) == 0) 626 if ((r & RMIXL_DRAM_BAR_STATUS) == 0)
627 continue; /* not enabled */ 627 continue; /* not enabled */

cvs diff -r1.21 -r1.22 src/sys/arch/evbppc/mpc85xx/machdep.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/mpc85xx/machdep.c 2011/08/02 00:25:38 1.21
+++ src/sys/arch/evbppc/mpc85xx/machdep.c 2012/01/27 18:52:54 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.21 2011/08/02 00:25:38 matt Exp $ */ 1/* $NetBSD: machdep.c,v 1.22 2012/01/27 18:52:54 para Exp $ */
2/*- 2/*-
3 * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. 3 * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects 7 * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects
8 * Agency and which was developed by Matt Thomas of 3am Software Foundry. 8 * Agency and which was developed by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * This material is based upon work supported by the Defense Advanced Research 10 * This material is based upon work supported by the Defense Advanced Research
11 * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under 11 * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
12 * Contract No. N66001-09-C-2073. 12 * Contract No. N66001-09-C-2073.
13 * Approved for Public Release, Distribution Unlimited 13 * Approved for Public Release, Distribution Unlimited
14 * 14 *
@@ -1359,32 +1359,32 @@ cpu_startup(void) @@ -1359,32 +1359,32 @@ cpu_startup(void)
1359 board_info_add_number("tsec2-phy-addr", MII_PHY_ANY); 1359 board_info_add_number("tsec2-phy-addr", MII_PHY_ANY);
1360 board_info_add_number("tsec3-phy-addr", MII_PHY_ANY); 1360 board_info_add_number("tsec3-phy-addr", MII_PHY_ANY);
1361 board_info_add_number("tsec4-phy-addr", MII_PHY_ANY); 1361 board_info_add_number("tsec4-phy-addr", MII_PHY_ANY);
1362#endif 1362#endif
1363 1363
1364 uint64_t macstnaddr = 1364 uint64_t macstnaddr =
1365 ((uint64_t)le32toh(cpu_read_4(ETSEC1_BASE + MACSTNADDR1)) << 16) 1365 ((uint64_t)le32toh(cpu_read_4(ETSEC1_BASE + MACSTNADDR1)) << 16)
1366 | ((uint64_t)le32toh(cpu_read_4(ETSEC1_BASE + MACSTNADDR2)) << 48); 1366 | ((uint64_t)le32toh(cpu_read_4(ETSEC1_BASE + MACSTNADDR2)) << 48);
1367 board_info_add_data("tsec-mac-addr-base", &macstnaddr, 6); 1367 board_info_add_data("tsec-mac-addr-base", &macstnaddr, 6);
1368 1368
1369#if NPCI > 0 && defined(PCI_MEMBASE) 1369#if NPCI > 0 && defined(PCI_MEMBASE)
1370 pcimem_ex = extent_create("pcimem", 1370 pcimem_ex = extent_create("pcimem",
1371 PCI_MEMBASE, PCI_MEMBASE + 4*PCI_MEMSIZE, 1371 PCI_MEMBASE, PCI_MEMBASE + 4*PCI_MEMSIZE,
1372 M_DEVBUF, NULL, 0, EX_WAITOK); 1372 NULL, 0, EX_WAITOK);
1373#endif 1373#endif
1374#if NPCI > 0 && defined(PCI_IOBASE) 1374#if NPCI > 0 && defined(PCI_IOBASE)
1375 pciio_ex = extent_create("pciio", 1375 pciio_ex = extent_create("pciio",
1376 PCI_IOBASE, PCI_IOBASE + 4*PCI_IOSIZE, 1376 PCI_IOBASE, PCI_IOBASE + 4*PCI_IOSIZE,
1377 M_DEVBUF, NULL, 0, EX_WAITOK); 1377 NULL, 0, EX_WAITOK);
1378#endif 1378#endif
1379 mpc85xx_extirq_setup(); 1379 mpc85xx_extirq_setup();
1380 /* 1380 /*
1381 * PCI-Express virtual wire interrupts on combined with 1381 * PCI-Express virtual wire interrupts on combined with
1382 * External IRQ0/1/2/3. 1382 * External IRQ0/1/2/3.
1383 */ 1383 */
1384 switch (svr) { 1384 switch (svr) {
1385#if defined(MPC8548) 1385#if defined(MPC8548)
1386 case SVR_MPC8548v1 >> 16: 1386 case SVR_MPC8548v1 >> 16:
1387 mpc85xx_pci_setup("pcie0-interrupt-map", 0x001800, 1387 mpc85xx_pci_setup("pcie0-interrupt-map", 0x001800,
1388 IST_LEVEL, 0, 1, 2, 3); 1388 IST_LEVEL, 0, 1, 2, 3);
1389 break; 1389 break;
1390#endif 1390#endif

cvs diff -r1.4 -r1.5 src/sys/arch/ews4800mips/ews4800mips/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/ews4800mips/ews4800mips/bus_space.c 2008/04/28 20:23:18 1.4
+++ src/sys/arch/ews4800mips/ews4800mips/bus_space.c 2012/01/27 18:52:55 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.4 2008/04/28 20:23:18 martin Exp $ */ 1/* $NetBSD: bus_space.c,v 1.5 2012/01/27 18:52:55 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.4 2008/04/28 20:23:18 martin Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.5 2012/01/27 18:52:55 para Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/malloc.h> 34#include <sys/malloc.h>
35#include <sys/extent.h> 35#include <sys/extent.h>
36 36
37#define _EWS4800MIPS_BUS_SPACE_PRIVATE 37#define _EWS4800MIPS_BUS_SPACE_PRIVATE
38#include <machine/bus.h> 38#include <machine/bus.h>
39#include <machine/sbdvar.h> 39#include <machine/sbdvar.h>
40 40
41#ifdef BUS_SPACE_DEBUG 41#ifdef BUS_SPACE_DEBUG
42int bus_space_debug = 0; 42int bus_space_debug = 0;
43#define DPRINTF(fmt, args...) \ 43#define DPRINTF(fmt, args...) \
@@ -156,27 +156,27 @@ bus_space_create(bus_space_tag_t t, cons @@ -156,27 +156,27 @@ bus_space_create(bus_space_tag_t t, cons
156 return EFAULT; 156 return EFAULT;
157 157
158 /* set default method */ 158 /* set default method */
159 *ebs = _default_bus_space; /* structure assignment */ 159 *ebs = _default_bus_space; /* structure assignment */
160 ebs->ebs_cookie = ebs; 160 ebs->ebs_cookie = ebs;
161 161
162 /* set access region */ 162 /* set access region */
163 if (size == 0) { 163 if (size == 0) {
164 /* no extent */ 164 /* no extent */
165 ebs->ebs_base_addr = addr; 165 ebs->ebs_base_addr = addr;
166 ebs->ebs_size = size; 166 ebs->ebs_size = size;
167 } else { 167 } else {
168 ebs->ebs_extent = extent_create(name, addr, addr + size - 1, 168 ebs->ebs_extent = extent_create(name, addr, addr + size - 1,
169 M_DEVBUF, 0, 0, EX_NOWAIT); 169 0, 0, EX_NOWAIT);
170 if (ebs->ebs_extent == NULL) { 170 if (ebs->ebs_extent == NULL) {
171 panic("%s:: unable to create bus_space for " 171 panic("%s:: unable to create bus_space for "
172 "0x%08lx-%#lx", __func__, addr, size); 172 "0x%08lx-%#lx", __func__, addr, size);
173 } 173 }
174 } 174 }
175 175
176 return 0; 176 return 0;
177} 177}
178 178
179void 179void
180bus_space_destroy(bus_space_tag_t t) 180bus_space_destroy(bus_space_tag_t t)
181{ 181{
182 struct ews4800mips_bus_space *ebs = t; 182 struct ews4800mips_bus_space *ebs = t;

cvs diff -r1.98 -r1.99 src/sys/arch/hp300/hp300/autoconf.c (expand / switch to unified diff)

--- src/sys/arch/hp300/hp300/autoconf.c 2011/05/10 14:38:08 1.98
+++ src/sys/arch/hp300/hp300/autoconf.c 2012/01/27 18:52:55 1.99
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $ */ 1/* $NetBSD: autoconf.c,v 1.99 2012/01/27 18:52:55 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -78,27 +78,27 @@ @@ -78,27 +78,27 @@
78 * 78 *
79 * @(#)autoconf.c 8.2 (Berkeley) 1/12/94 79 * @(#)autoconf.c 8.2 (Berkeley) 1/12/94
80 */ 80 */
81 81
82/* 82/*
83 * Setup the system to run on the current machine. 83 * Setup the system to run on the current machine.
84 * 84 *
85 * Configure() is called at boot time. Available 85 * Configure() is called at boot time. Available
86 * devices are determined (from possibilities mentioned in ioconf.c), 86 * devices are determined (from possibilities mentioned in ioconf.c),
87 * and the drivers are initialized. 87 * and the drivers are initialized.
88 */ 88 */
89 89
90#include <sys/cdefs.h> 90#include <sys/cdefs.h>
91__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $"); 91__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.99 2012/01/27 18:52:55 para Exp $");
92 92
93#include "dvbox.h" 93#include "dvbox.h"
94#include "gbox.h" 94#include "gbox.h"
95#include "hyper.h" 95#include "hyper.h"
96#include "rbox.h" 96#include "rbox.h"
97#include "topcat.h" 97#include "topcat.h"
98#include "tvrx.h" 98#include "tvrx.h"
99#include "gendiofb.h" 99#include "gendiofb.h"
100#include "com_dio.h" 100#include "com_dio.h"
101#include "com_frodo.h" 101#include "com_frodo.h"
102#include "dcm.h" 102#include "dcm.h"
103 103
104#include <sys/param.h> 104#include <sys/param.h>
@@ -890,27 +890,27 @@ dio_scode_probe(int scode, int (*func)(b @@ -890,27 +890,27 @@ dio_scode_probe(int scode, int (*func)(b
890/********************************************************************** 890/**********************************************************************
891 * Mapping functions 891 * Mapping functions
892 **********************************************************************/ 892 **********************************************************************/
893 893
894/* 894/*
895 * Initialize the external I/O extent map. 895 * Initialize the external I/O extent map.
896 */ 896 */
897void 897void
898iomap_init(void) 898iomap_init(void)
899{ 899{
900 900
901 /* extiobase is initialized by pmap_bootstrap(). */ 901 /* extiobase is initialized by pmap_bootstrap(). */
902 extio_ex = extent_create("extio", (u_long) extiobase, 902 extio_ex = extent_create("extio", (u_long) extiobase,
903 (u_long) extiobase + (ptoa(EIOMAPSIZE) - 1), M_DEVBUF, 903 (u_long) extiobase + (ptoa(EIOMAPSIZE) - 1),
904 (void *) extio_ex_storage, sizeof(extio_ex_storage), 904 (void *) extio_ex_storage, sizeof(extio_ex_storage),
905 EX_NOCOALESCE|EX_NOWAIT); 905 EX_NOCOALESCE|EX_NOWAIT);
906} 906}
907 907
908/* 908/*
909 * Allocate/deallocate a cache-inhibited range of kernel virtual address 909 * Allocate/deallocate a cache-inhibited range of kernel virtual address
910 * space mapping the indicated physical address range [pa - pa+size) 910 * space mapping the indicated physical address range [pa - pa+size)
911 */ 911 */
912void * 912void *
913iomap(void *pa, int size) 913iomap(void *pa, int size)
914{ 914{
915 u_long kva; 915 u_long kva;
916 int error; 916 int error;

cvs diff -r1.13 -r1.14 src/sys/arch/hp700/dev/Attic/astro.c (expand / switch to unified diff)

--- src/sys/arch/hp700/dev/Attic/astro.c 2011/01/13 21:15:13 1.13
+++ src/sys/arch/hp700/dev/Attic/astro.c 2012/01/27 18:52:55 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: astro.c,v 1.13 2011/01/13 21:15:13 skrll Exp $ */ 1/* $NetBSD: astro.c,v 1.14 2012/01/27 18:52:55 para Exp $ */
2 2
3/* $OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $ */ 3/* $OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $ */
4 4
5/* 5/*
6 * Copyright (c) 2007 Mark Kettenis 6 * Copyright (c) 2007 Mark Kettenis
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above 9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies. 10 * copyright notice and this permission notice appear in all copies.
11 * 11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -318,27 +318,27 @@ astro_attach(device_t parent, device_t s @@ -318,27 +318,27 @@ astro_attach(device_t parent, device_t s
318 if (PAGE0->mem_cons.pz_class != PCL_DUPLEX) 318 if (PAGE0->mem_cons.pz_class != PCL_DUPLEX)
319 pdcproc_ioreset(); 319 pdcproc_ioreset();
320 hp700_pagezero_unmap(pagezero_cookie); 320 hp700_pagezero_unmap(pagezero_cookie);
321 321
322 /* Enable iova space. */ 322 /* Enable iova space. */
323 r->tlb_ibase = htole32(1); 323 r->tlb_ibase = htole32(1);
324 324
325 /* 325 /*
326 * Now all the hardware's working we need to allocate a dvma map. 326 * Now all the hardware's working we need to allocate a dvma map.
327 */ 327 */
328 snprintf(sc->sc_dvmamapname, sizeof(sc->sc_dvmamapname), 328 snprintf(sc->sc_dvmamapname, sizeof(sc->sc_dvmamapname),
329 "%s_dvma", device_xname(sc->sc_dv)); 329 "%s_dvma", device_xname(sc->sc_dv));
330 sc->sc_dvmamap = extent_create(sc->sc_dvmamapname, 0, (1 << iova_bits), 330 sc->sc_dvmamap = extent_create(sc->sc_dvmamapname, 0, (1 << iova_bits),
331 M_DEVBUF, 0, 0, EX_NOWAIT); 331 0, 0, EX_NOWAIT);
332 332
333 sc->sc_dmatag = astro_dmat; 333 sc->sc_dmatag = astro_dmat;
334 sc->sc_dmatag._cookie = sc; 334 sc->sc_dmatag._cookie = sc;
335 335
336 nca = *ca; /* clone from us */ 336 nca = *ca; /* clone from us */
337 nca.ca_dmatag = &sc->sc_dmatag; 337 nca.ca_dmatag = &sc->sc_dmatag;
338 nca.ca_hpabase = IOMOD_IO_IO_LOW(p); 338 nca.ca_hpabase = IOMOD_IO_IO_LOW(p);
339 nca.ca_nmodules = MAXMODBUS; 339 nca.ca_nmodules = MAXMODBUS;
340 pdc_scanbus(self, &nca, astro_callback); 340 pdc_scanbus(self, &nca, astro_callback);
341} 341}
342 342
343static device_t 343static device_t
344astro_callback(device_t self, struct confargs *ca) 344astro_callback(device_t self, struct confargs *ca)

cvs diff -r1.32 -r1.33 src/sys/arch/hp700/dev/Attic/dino.c (expand / switch to unified diff)

--- src/sys/arch/hp700/dev/Attic/dino.c 2011/05/17 17:34:49 1.32
+++ src/sys/arch/hp700/dev/Attic/dino.c 2012/01/27 18:52:55 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dino.c,v 1.32 2011/05/17 17:34:49 dyoung Exp $ */ 1/* $NetBSD: dino.c,v 1.33 2012/01/27 18:52:55 para Exp $ */
2 2
3/* $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */ 3/* $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */
4 4
5/* 5/*
6 * Copyright (c) 2003 Michael Shalayeff 6 * Copyright (c) 2003 Michael Shalayeff
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, 21 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE. 28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.32 2011/05/17 17:34:49 dyoung Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.33 2012/01/27 18:52:55 para Exp $");
33 33
34/* #include "cardbus.h" */ 34/* #include "cardbus.h" */
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/reboot.h> 39#include <sys/reboot.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42 42
43#include <machine/iomod.h> 43#include <machine/iomod.h>
44#include <machine/autoconf.h> 44#include <machine/autoconf.h>
45#include <machine/intr.h> 45#include <machine/intr.h>
@@ -1633,27 +1633,27 @@ dinoattach(device_t parent, device_t sel @@ -1633,27 +1633,27 @@ dinoattach(device_t parent, device_t sel
1633 r->pamr = 0; 1633 r->pamr = 0;
1634 r->papr = 0; 1634 r->papr = 0;
1635 r->io_fbb_en |= 1; 1635 r->io_fbb_en |= 1;
1636 r->damode = 0; 1636 r->damode = 0;
1637 r->gmask &= ~1; /* allow GSC bus req */ 1637 r->gmask &= ~1; /* allow GSC bus req */
1638 r->pciror = 0; 1638 r->pciror = 0;
1639 r->pciwor = 0; 1639 r->pciwor = 0;
1640 r->brdg_feat = 0xc0000000; 1640 r->brdg_feat = 0xc0000000;
1641#endif 1641#endif
1642 1642
1643 snprintf(sc->sc_ioexname, sizeof(sc->sc_ioexname), 1643 snprintf(sc->sc_ioexname, sizeof(sc->sc_ioexname),
1644 "%s_io", device_xname(self)); 1644 "%s_io", device_xname(self));
1645 if ((sc->sc_ioex = extent_create(sc->sc_ioexname, 0, 0xffff, 1645 if ((sc->sc_ioex = extent_create(sc->sc_ioexname, 0, 0xffff,
1646 M_DEVBUF, NULL, 0, EX_NOWAIT | EX_MALLOCOK)) == NULL) { 1646 NULL, 0, EX_NOWAIT | EX_MALLOCOK)) == NULL) {
1647 aprint_error(": can't allocate I/O extent map\n"); 1647 aprint_error(": can't allocate I/O extent map\n");
1648 bus_space_unmap(sc->sc_bt, sc->sc_bh, PAGE_SIZE); 1648 bus_space_unmap(sc->sc_bt, sc->sc_bh, PAGE_SIZE);
1649 return; 1649 return;
1650 } 1650 }
1651 1651
1652 /* interrupts guts */ 1652 /* interrupts guts */
1653 s = splhigh(); 1653 s = splhigh();
1654 r->icr = 0; 1654 r->icr = 0;
1655 r->imr = ~0; 1655 r->imr = ~0;
1656 data = r->irr0; 1656 data = r->irr0;
1657 r->imr = 0; 1657 r->imr = 0;
1658 r->iar0 = cpu_gethpa(0) | (31 - ca->ca_irq); 1658 r->iar0 = cpu_gethpa(0) | (31 - ca->ca_irq);
1659 splx(s); 1659 splx(s);

cvs diff -r1.11 -r1.12 src/sys/arch/hp700/dev/Attic/elroy.c (expand / switch to unified diff)

--- src/sys/arch/hp700/dev/Attic/elroy.c 2011/05/17 17:34:49 1.11
+++ src/sys/arch/hp700/dev/Attic/elroy.c 2012/01/27 18:52:56 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: elroy.c,v 1.11 2011/05/17 17:34:49 dyoung Exp $ */ 1/* $NetBSD: elroy.c,v 1.12 2012/01/27 18:52:56 para Exp $ */
2 2
3/* $OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $ */ 3/* $OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $ */
4 4
5/* 5/*
6 * Copyright (c) 2005 Michael Shalayeff 6 * Copyright (c) 2005 Michael Shalayeff
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * Permission to use, copy, modify, and distribute this software for any 9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above 10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies. 11 * copyright notice and this permission notice appear in all copies.
12 * 12 *
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@@ -444,27 +444,27 @@ elroy_alloc_parent(device_t self, struct @@ -444,27 +444,27 @@ elroy_alloc_parent(device_t self, struct
444 } else { 444 } else {
445 if (!sc->sc_memex) { 445 if (!sc->sc_memex) {
446 bus_space_handle_t memh; 446 bus_space_handle_t memh;
447 bus_addr_t mem_start; 447 bus_addr_t mem_start;
448 448
449 if (elroy_memalloc(sc, 0xf0800000, 0xff7fffff, 449 if (elroy_memalloc(sc, 0xf0800000, 0xff7fffff,
450 ELROY_MEM_WINDOW, ELROY_MEM_WINDOW, EX_NOBOUNDARY, 450 ELROY_MEM_WINDOW, ELROY_MEM_WINDOW, EX_NOBOUNDARY,
451 0, &mem_start, &memh)) 451 0, &mem_start, &memh))
452 return (NULL); 452 return (NULL);
453 453
454 snprintf(sc->sc_memexname, sizeof(sc->sc_memexname), 454 snprintf(sc->sc_memexname, sizeof(sc->sc_memexname),
455 "%s_mem", sc->sc_dv.dv_xname); 455 "%s_mem", sc->sc_dv.dv_xname);
456 if ((sc->sc_memex = extent_create(sc->sc_memexname, 456 if ((sc->sc_memex = extent_create(sc->sc_memexname,
457 mem_start, mem_start + ELROY_MEM_WINDOW, M_DEVBUF, 457 mem_start, mem_start + ELROY_MEM_WINDOW,
458 NULL, 0, EX_NOWAIT | EX_MALLOCOK)) == NULL) { 458 NULL, 0, EX_NOWAIT | EX_MALLOCOK)) == NULL) {
459 extent_destroy(sc->sc_ioex); 459 extent_destroy(sc->sc_ioex);
460 bus_space_free(sc->sc_bt, memh, 460 bus_space_free(sc->sc_bt, memh,
461 ELROY_MEM_WINDOW); 461 ELROY_MEM_WINDOW);
462 return (NULL); 462 return (NULL);
463 } 463 }
464 } 464 }
465 ex = sc->sc_memex; 465 ex = sc->sc_memex;
466 tag = pa->pa_memt; 466 tag = pa->pa_memt;
467 start = ex->ex_start; 467 start = ex->ex_start;
468 size = ELROY_MEM_CHUNK; 468 size = ELROY_MEM_CHUNK;
469 } 469 }
470 470

cvs diff -r1.104 -r1.105 src/sys/arch/hp700/hp700/Attic/machdep.c (expand / switch to unified diff)

--- src/sys/arch/hp700/hp700/Attic/machdep.c 2012/01/09 19:40:54 1.104
+++ src/sys/arch/hp700/hp700/Attic/machdep.c 2012/01/27 18:52:56 1.105
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.104 2012/01/09 19:40:54 skrll Exp $ */ 1/* $NetBSD: machdep.c,v 1.105 2012/01/27 18:52:56 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matthew Fredette. 8 * by Matthew Fredette.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -48,27 +48,27 @@ @@ -48,27 +48,27 @@
48 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 48 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
50 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, 50 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
51 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 51 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
52 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 52 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
53 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 53 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 54 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
55 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 55 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
56 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 56 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
57 * THE POSSIBILITY OF SUCH DAMAGE. 57 * THE POSSIBILITY OF SUCH DAMAGE.
58 */ 58 */
59 59
60#include <sys/cdefs.h> 60#include <sys/cdefs.h>
61__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.104 2012/01/09 19:40:54 skrll Exp $"); 61__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.105 2012/01/27 18:52:56 para Exp $");
62 62
63#include "opt_cputype.h" 63#include "opt_cputype.h"
64#include "opt_ddb.h" 64#include "opt_ddb.h"
65#include "opt_kgdb.h" 65#include "opt_kgdb.h"
66#include "opt_modular.h" 66#include "opt_modular.h"
67#include "opt_useleds.h" 67#include "opt_useleds.h"
68 68
69#include <sys/param.h> 69#include <sys/param.h>
70#include <sys/systm.h> 70#include <sys/systm.h>
71#include <sys/signalvar.h> 71#include <sys/signalvar.h>
72#include <sys/kernel.h> 72#include <sys/kernel.h>
73#include <sys/proc.h> 73#include <sys/proc.h>
74#include <sys/buf.h> 74#include <sys/buf.h>
@@ -505,27 +505,27 @@ hppa_init(paddr_t start, void *bi) @@ -505,27 +505,27 @@ hppa_init(paddr_t start, void *bi)
505 cpuid(); 505 cpuid();
506 ptlball(); 506 ptlball();
507 fcacheall(); 507 fcacheall();
508 508
509 avail_end = trunc_page(PAGE0->imm_max_mem); 509 avail_end = trunc_page(PAGE0->imm_max_mem);
510 totalphysmem = atop(avail_end); 510 totalphysmem = atop(avail_end);
511 if (avail_end > SYSCALLGATE) 511 if (avail_end > SYSCALLGATE)
512 avail_end = SYSCALLGATE; 512 avail_end = SYSCALLGATE;
513 physmem = atop(avail_end); 513 physmem = atop(avail_end);
514 resvmem = atop(resvmem); /* XXXNH */ 514 resvmem = atop(resvmem); /* XXXNH */
515 515
516 /* we hope this won't fail */ 516 /* we hope this won't fail */
517 hp700_io_extent = extent_create("io", 517 hp700_io_extent = extent_create("io",
518 HPPA_IOSPACE, 0xffffffff, M_DEVBUF, 518 HPPA_IOSPACE, 0xffffffff,
519 (void *)hp700_io_extent_store, sizeof(hp700_io_extent_store), 519 (void *)hp700_io_extent_store, sizeof(hp700_io_extent_store),
520 EX_NOCOALESCE|EX_NOWAIT); 520 EX_NOCOALESCE|EX_NOWAIT);
521 521
522 vstart = round_page(start); 522 vstart = round_page(start);
523 523
524 /* 524 /*
525 * Now allocate kernel dynamic variables 525 * Now allocate kernel dynamic variables
526 */ 526 */
527 527
528 /* Allocate the msgbuf. */ 528 /* Allocate the msgbuf. */
529 msgbufaddr = (void *) vstart; 529 msgbufaddr = (void *) vstart;
530 vstart += MSGBUFSIZE; 530 vstart += MSGBUFSIZE;
531 vstart = round_page(vstart); 531 vstart = round_page(vstart);

cvs diff -r1.30 -r1.31 src/sys/arch/hpcmips/hpcmips/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/hpcmips/hpcmips/bus_space.c 2011/02/26 12:07:45 1.30
+++ src/sys/arch/hpcmips/hpcmips/bus_space.c 2012/01/27 18:52:56 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.30 2011/02/26 12:07:45 tsutsui Exp $ */ 1/* $NetBSD: bus_space.c,v 1.31 2012/01/27 18:52:56 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.30 2011/02/26 12:07:45 tsutsui Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.31 2012/01/27 18:52:56 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/extent.h> 39#include <sys/extent.h>
40 40
41#include <uvm/uvm_extern.h> 41#include <uvm/uvm_extern.h>
42 42
43#include <mips/cache.h> 43#include <mips/cache.h>
44#include <mips/locore.h> 44#include <mips/locore.h>
45#include <mips/pte.h> 45#include <mips/pte.h>
46#include <machine/bus.h> 46#include <machine/bus.h>
47#include <machine/bus_space_hpcmips.h> 47#include <machine/bus_space_hpcmips.h>
@@ -206,27 +206,27 @@ hpcmips_init_bus_space(struct bus_space_ @@ -206,27 +206,27 @@ hpcmips_init_bus_space(struct bus_space_
206 "can't allocate kernel virtual"); 206 "can't allocate kernel virtual");
207 } 207 }
208 DPRINTF(("pa:0x%08x -> kv:0x%08x+0x%08x", 208 DPRINTF(("pa:0x%08x -> kv:0x%08x+0x%08x",
209 (unsigned int)t->base, (unsigned int)va, t->size)); 209 (unsigned int)t->base, (unsigned int)va, t->size));
210 t->base = va; /* kseg2 addr */ 210 t->base = va; /* kseg2 addr */
211  211
212 for (; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { 212 for (; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) {
213 pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE, 0); 213 pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE, 0);
214 } 214 }
215 pmap_update(pmap_kernel()); 215 pmap_update(pmap_kernel());
216 } 216 }
217 217
218 t->extent = (void*)extent_create(t->name, t->base,  218 t->extent = (void*)extent_create(t->name, t->base,
219 t->base + t->size, M_DEVBUF, 219 t->base + t->size,
220 0, 0, EX_NOWAIT); 220 0, 0, EX_NOWAIT);
221 if (!t->extent) { 221 if (!t->extent) {
222 panic("hpcmips_init_bus_space_extent:" 222 panic("hpcmips_init_bus_space_extent:"
223 "unable to allocate %s map", t->name); 223 "unable to allocate %s map", t->name);
224 } 224 }
225} 225}
226 226
227bus_space_handle_t 227bus_space_handle_t
228__hpcmips_cacheable(struct bus_space_tag_hpcmips *t, bus_addr_t bpa, 228__hpcmips_cacheable(struct bus_space_tag_hpcmips *t, bus_addr_t bpa,
229 bus_size_t size, int cacheable) 229 bus_size_t size, int cacheable)
230{ 230{
231 vaddr_t va, endva; 231 vaddr_t va, endva;
232 pt_entry_t *pte; 232 pt_entry_t *pte;

cvs diff -r1.40 -r1.41 src/sys/arch/hpcmips/tx/tx3912video.c (expand / switch to unified diff)

--- src/sys/arch/hpcmips/tx/tx3912video.c 2009/03/14 15:36:07 1.40
+++ src/sys/arch/hpcmips/tx/tx3912video.c 2012/01/27 18:52:56 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tx3912video.c,v 1.40 2009/03/14 15:36:07 dsl Exp $ */ 1/* $NetBSD: tx3912video.c,v 1.41 2012/01/27 18:52:56 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by UCHIYAMA Yasushi. 8 * by UCHIYAMA Yasushi.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: tx3912video.c,v 1.40 2009/03/14 15:36:07 dsl Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: tx3912video.c,v 1.41 2012/01/27 18:52:56 para Exp $");
34 34
35#define TX3912VIDEO_DEBUG 35#define TX3912VIDEO_DEBUG
36 36
37#include "hpcfb.h" 37#include "hpcfb.h"
38#include "bivideo.h" 38#include "bivideo.h"
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/extent.h> 43#include <sys/extent.h>
44 44
45#include <sys/ioctl.h> 45#include <sys/ioctl.h>
46#include <sys/buf.h> 46#include <sys/buf.h>
@@ -356,27 +356,27 @@ tx3912video_framebuffer_alloc(struct vid @@ -356,27 +356,27 @@ tx3912video_framebuffer_alloc(struct vid
356 paddr_t *fb_end /* buffer allocation hint */) 356 paddr_t *fb_end /* buffer allocation hint */)
357{ 357{
358 struct extent_fixed ex_fixed[10]; 358 struct extent_fixed ex_fixed[10];
359 struct extent *ex; 359 struct extent *ex;
360 u_long addr, size; 360 u_long addr, size;
361 int error; 361 int error;
362 362
363 /* calcurate frame buffer size */ 363 /* calcurate frame buffer size */
364 size = (chip->vc_fbwidth * chip->vc_fbheight * chip->vc_fbdepth) / 364 size = (chip->vc_fbwidth * chip->vc_fbheight * chip->vc_fbdepth) /
365 NBBY; 365 NBBY;
366 366
367 /* extent V-RAM region */ 367 /* extent V-RAM region */
368 ex = extent_create("Frame buffer address", fb_start, *fb_end, 368 ex = extent_create("Frame buffer address", fb_start, *fb_end,
369 0, (void *)ex_fixed, sizeof ex_fixed, 369 (void *)ex_fixed, sizeof ex_fixed,
370 EX_NOWAIT); 370 EX_NOWAIT);
371 if (ex == 0) 371 if (ex == 0)
372 return (1); 372 return (1);
373 373
374 /* Allocate V-RAM area */ 374 /* Allocate V-RAM area */
375 error = extent_alloc_subregion(ex, fb_start, fb_start + size - 1, 375 error = extent_alloc_subregion(ex, fb_start, fb_start + size - 1,
376 size, TX3912_FRAMEBUFFER_ALIGNMENT, 376 size, TX3912_FRAMEBUFFER_ALIGNMENT,
377 TX3912_FRAMEBUFFER_BOUNDARY, EX_FAST|EX_NOWAIT, &addr); 377 TX3912_FRAMEBUFFER_BOUNDARY, EX_FAST|EX_NOWAIT, &addr);
378 extent_destroy(ex); 378 extent_destroy(ex);
379 379
380 if (error != 0) 380 if (error != 0)
381 return (1); 381 return (1);
382 382

cvs diff -r1.18 -r1.19 src/sys/arch/hpcsh/hpcsh/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/hpcsh/hpcsh/bus_space.c 2011/07/20 20:46:49 1.18
+++ src/sys/arch/hpcsh/hpcsh/bus_space.c 2012/01/27 18:52:57 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.18 2011/07/20 20:46:49 dyoung Exp $ */ 1/* $NetBSD: bus_space.c,v 1.19 2012/01/27 18:52:57 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.18 2011/07/20 20:46:49 dyoung Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.19 2012/01/27 18:52:57 para Exp $");
31 31
32#include "debug_hpcsh.h" 32#include "debug_hpcsh.h"
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/malloc.h> 36#include <sys/malloc.h>
37#include <sys/extent.h> 37#include <sys/extent.h>
38#include <sys/bus.h> 38#include <sys/bus.h>
39 39
40/* bus.h turn on BUS_SPACE_DEBUG if the global DEBUG option is enabled. */ 40/* bus.h turn on BUS_SPACE_DEBUG if the global DEBUG option is enabled. */
41#ifdef BUS_SPACE_DEBUG 41#ifdef BUS_SPACE_DEBUG
42#define DPRINTF_ENABLE 42#define DPRINTF_ENABLE
43#define DPRINTF_DEBUG bus_space_debug 43#define DPRINTF_DEBUG bus_space_debug
@@ -146,27 +146,27 @@ bus_space_create(struct hpcsh_bus_space  @@ -146,27 +146,27 @@ bus_space_create(struct hpcsh_bus_space
146 } else 146 } else
147 memset(hbs, 0, sizeof(*hbs)); 147 memset(hbs, 0, sizeof(*hbs));
148 KASSERT(hbs); 148 KASSERT(hbs);
149 149
150 /* set default method */ 150 /* set default method */
151 *hbs = __default_bus_space; 151 *hbs = __default_bus_space;
152 hbs->hbs_cookie = hbs; 152 hbs->hbs_cookie = hbs;
153 153
154 /* set access region */ 154 /* set access region */
155 if (size == 0) { 155 if (size == 0) {
156 hbs->hbs_base_addr = addr; /* no extent */ 156 hbs->hbs_base_addr = addr; /* no extent */
157 } else { 157 } else {
158 hbs->hbs_extent = extent_create(name, addr, addr + size - 1, 158 hbs->hbs_extent = extent_create(name, addr, addr + size - 1,
159 M_DEVBUF, 0, 0, EX_NOWAIT); 159 0, 0, EX_NOWAIT);
160 if (hbs->hbs_extent == NULL) { 160 if (hbs->hbs_extent == NULL) {
161 panic("%s:: unable to create bus_space for " 161 panic("%s:: unable to create bus_space for "
162 "0x%08lx-%#lx", __func__, addr, size); 162 "0x%08lx-%#lx", __func__, addr, size);
163 } 163 }
164 } 164 }
165 165
166 return hbs; 166 return hbs;
167} 167}
168 168
169void 169void
170bus_space_destroy(bus_space_tag_t t) 170bus_space_destroy(bus_space_tag_t t)
171{ 171{
172 struct hpcsh_bus_space *hbs = t; 172 struct hpcsh_bus_space *hbs = t;

cvs diff -r1.10 -r1.11 src/sys/arch/ibmnws/ibmnws/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/ibmnws/ibmnws/mainbus.c 2011/07/01 20:47:43 1.10
+++ src/sys/arch/ibmnws/ibmnws/mainbus.c 2012/01/27 18:52:57 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.10 2011/07/01 20:47:43 dyoung Exp $ */ 1/* $NetBSD: mainbus.c,v 1.11 2012/01/27 18:52:57 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -114,29 +114,29 @@ mainbus_attach(device_t parent, device_t @@ -114,29 +114,29 @@ mainbus_attach(device_t parent, device_t
114 /* 114 /*
115 * XXX Note also that the presence of a PCI bus should 115 * XXX Note also that the presence of a PCI bus should
116 * XXX _always_ be checked, and if present the bus should be 116 * XXX _always_ be checked, and if present the bus should be
117 * XXX 'found'. However, because of the structure of the code, 117 * XXX 'found'. However, because of the structure of the code,
118 * XXX that's not currently possible. 118 * XXX that's not currently possible.
119 */ 119 */
120#if NPCI > 0 120#if NPCI > 0
121 genppc_pct = malloc(sizeof(struct genppc_pci_chipset), M_DEVBUF, 121 genppc_pct = malloc(sizeof(struct genppc_pci_chipset), M_DEVBUF,
122 M_NOWAIT); 122 M_NOWAIT);
123 KASSERT(genppc_pct != NULL); 123 KASSERT(genppc_pct != NULL);
124 ibmnws_pci_get_chipset_tag_indirect (genppc_pct); 124 ibmnws_pci_get_chipset_tag_indirect (genppc_pct);
125 125
126#ifdef PCI_NETBSD_CONFIGURE 126#ifdef PCI_NETBSD_CONFIGURE
127 ioext = extent_create("pciio", 0x00008000, 0x0000ffff, M_DEVBUF, 127 ioext = extent_create("pciio", 0x00008000, 0x0000ffff,
128 NULL, 0, EX_NOWAIT); 128 NULL, 0, EX_NOWAIT);
129 memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF, 129 memext = extent_create("pcimem", 0x00000000, 0x0fffffff,
130 NULL, 0, EX_NOWAIT); 130 NULL, 0, EX_NOWAIT);
131 131
132 pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE); 132 pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE);
133 133
134 extent_destroy(ioext); 134 extent_destroy(ioext);
135 extent_destroy(memext); 135 extent_destroy(memext);
136#endif 136#endif
137 137
138 memset(&mba, 0, sizeof(mba)); 138 memset(&mba, 0, sizeof(mba));
139 mba.mba_pba.pba_iot = &prep_io_space_tag; 139 mba.mba_pba.pba_iot = &prep_io_space_tag;
140 mba.mba_pba.pba_memt = &prep_mem_space_tag; 140 mba.mba_pba.pba_memt = &prep_mem_space_tag;
141 mba.mba_pba.pba_dmat = &pci_bus_dma_tag; 141 mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
142 mba.mba_pba.pba_dmat64 = NULL; 142 mba.mba_pba.pba_dmat64 = NULL;

cvs diff -r1.342 -r1.343 src/sys/arch/mac68k/mac68k/machdep.c (expand / switch to unified diff)

--- src/sys/arch/mac68k/mac68k/machdep.c 2011/12/12 19:03:10 1.342
+++ src/sys/arch/mac68k/mac68k/machdep.c 2012/01/27 18:52:57 1.343
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.342 2011/12/12 19:03:10 mrg Exp $ */ 1/* $NetBSD: machdep.c,v 1.343 2012/01/27 18:52:57 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1982, 1990 The Regents of the University of California. 5 * Copyright (c) 1982, 1990 The Regents of the University of California.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department. 10 * Science Department.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -64,27 +64,27 @@ @@ -64,27 +64,27 @@
64 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 64 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
65 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 65 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
66 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 66 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
67 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68 * 68 *
69 */ 69 */
70/* 70/*
71 * from: Utah $Hdr: machdep.c 1.63 91/04/24$ 71 * from: Utah $Hdr: machdep.c 1.63 91/04/24$
72 * 72 *
73 * @(#)machdep.c 7.16 (Berkeley) 6/3/91 73 * @(#)machdep.c 7.16 (Berkeley) 6/3/91
74 */ 74 */
75 75
76#include <sys/cdefs.h> 76#include <sys/cdefs.h>
77__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.342 2011/12/12 19:03:10 mrg Exp $"); 77__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.343 2012/01/27 18:52:57 para Exp $");
78 78
79#include "opt_adb.h" 79#include "opt_adb.h"
80#include "opt_ddb.h" 80#include "opt_ddb.h"
81#include "opt_ddbparam.h" 81#include "opt_ddbparam.h"
82#include "opt_kgdb.h" 82#include "opt_kgdb.h"
83#include "opt_modular.h" 83#include "opt_modular.h"
84#include "opt_compat_netbsd.h" 84#include "opt_compat_netbsd.h"
85#include "akbd.h" 85#include "akbd.h"
86#include "macfb.h" 86#include "macfb.h"
87#include "zsc.h" 87#include "zsc.h"
88 88
89#include <sys/param.h> 89#include <sys/param.h>
90#include <sys/systm.h> 90#include <sys/systm.h>
@@ -268,27 +268,27 @@ mac68k_init(void) @@ -268,27 +268,27 @@ mac68k_init(void)
268 VM_FREELIST_DEFAULT); 268 VM_FREELIST_DEFAULT);
269 } 269 }
270 270
271 /* 271 /*
272 * Initialize the I/O mem extent map. 272 * Initialize the I/O mem extent map.
273 * Note: we don't have to check the return value since 273 * Note: we don't have to check the return value since
274 * creation of a fixed extent map will never fail (since 274 * creation of a fixed extent map will never fail (since
275 * descriptor storage has already been allocated). 275 * descriptor storage has already been allocated).
276 * 276 *
277 * N.B. The iomem extent manages _all_ physical addresses 277 * N.B. The iomem extent manages _all_ physical addresses
278 * on the machine. When the amount of RAM is found, all 278 * on the machine. When the amount of RAM is found, all
279 * extents of RAM are allocated from the map. 279 * extents of RAM are allocated from the map.
280 */ 280 */
281 iomem_ex = extent_create("iomem", 0x0, 0xffffffff, M_DEVBUF, 281 iomem_ex = extent_create("iomem", 0x0, 0xffffffff,
282 (void *)iomem_ex_storage, sizeof(iomem_ex_storage), 282 (void *)iomem_ex_storage, sizeof(iomem_ex_storage),
283 EX_NOCOALESCE|EX_NOWAIT); 283 EX_NOCOALESCE|EX_NOWAIT);
284 284
285 /* Initialize the interrupt handlers. */ 285 /* Initialize the interrupt handlers. */
286 intr_init(); 286 intr_init();
287 287
288 /* Initialize the IOPs (if present) */ 288 /* Initialize the IOPs (if present) */
289 iop_init(1); 289 iop_init(1);
290 290
291 /* 291 /*
292 * Initialize error message buffer (at end of core). 292 * Initialize error message buffer (at end of core).
293 * high[numranges-1] was decremented in pmap_bootstrap. 293 * high[numranges-1] was decremented in pmap_bootstrap.
294 */ 294 */

cvs diff -r1.13 -r1.14 src/sys/arch/mips/alchemy/au_himem_space.c (expand / switch to unified diff)

--- src/sys/arch/mips/alchemy/au_himem_space.c 2011/07/10 23:13:23 1.13
+++ src/sys/arch/mips/alchemy/au_himem_space.c 2012/01/27 18:52:57 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: au_himem_space.c,v 1.13 2011/07/10 23:13:23 matt Exp $ */ 1/* $NetBSD: au_himem_space.c,v 1.14 2012/01/27 18:52:57 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Garrett D'Amore for Itronix Inc. 7 * Written by Garrett D'Amore for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 51 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
52 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 52 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
53 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 53 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
54 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 54 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
55 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 55 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
56 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 56 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60 * POSSIBILITY OF SUCH DAMAGE. 60 * POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: au_himem_space.c,v 1.13 2011/07/10 23:13:23 matt Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: au_himem_space.c,v 1.14 2012/01/27 18:52:57 para Exp $");
65 65
66/* 66/*
67 * This provides mappings for the upper I/O regions used on some 67 * This provides mappings for the upper I/O regions used on some
68 * Alchemy parts, e.g. PCI, PCMCIA, and LCD. The mappings do not use 68 * Alchemy parts, e.g. PCI, PCMCIA, and LCD. The mappings do not use
69 * wired TLB entries, but instead rely on wiring entries in the kernel 69 * wired TLB entries, but instead rely on wiring entries in the kernel
70 * pmap. 70 * pmap.
71 */ 71 */
72 72
73#include <sys/param.h> 73#include <sys/param.h>
74#include <sys/systm.h> 74#include <sys/systm.h>
75#include <sys/extent.h> 75#include <sys/extent.h>
76#include <sys/malloc.h> 76#include <sys/malloc.h>
77#include <sys/endian.h> 77#include <sys/endian.h>
@@ -691,27 +691,27 @@ au_himem_space_init(bus_space_tag_t bst, @@ -691,27 +691,27 @@ au_himem_space_init(bus_space_tag_t bst,
691 paddr_t physoff, bus_addr_t start, bus_addr_t end, int flags) 691 paddr_t physoff, bus_addr_t start, bus_addr_t end, int flags)
692{ 692{
693 au_himem_cookie_t *c; 693 au_himem_cookie_t *c;
694 694
695 c = malloc(sizeof (struct au_himem_cookie), M_DEVBUF, 695 c = malloc(sizeof (struct au_himem_cookie), M_DEVBUF,
696 M_NOWAIT | M_ZERO); 696 M_NOWAIT | M_ZERO);
697 697
698 c->c_name = name; 698 c->c_name = name;
699 c->c_start = start; 699 c->c_start = start;
700 c->c_end = end; 700 c->c_end = end;
701 c->c_physoff = physoff; 701 c->c_physoff = physoff;
702 702
703 /* allocate extent manager */ 703 /* allocate extent manager */
704 c->c_extent = extent_create(name, start, end, M_DEVBUF, 704 c->c_extent = extent_create(name, start, end,
705 NULL, 0, EX_NOWAIT); 705 NULL, 0, EX_NOWAIT);
706 if (c->c_extent == NULL) 706 if (c->c_extent == NULL)
707 panic("au_himem_space_init: %s: cannot create extent", name); 707 panic("au_himem_space_init: %s: cannot create extent", name);
708 708
709#if _BYTE_ORDER == _BIG_ENDIAN 709#if _BYTE_ORDER == _BIG_ENDIAN
710 if (flags & AU_HIMEM_SPACE_LITTLE_ENDIAN) { 710 if (flags & AU_HIMEM_SPACE_LITTLE_ENDIAN) {
711 if (flags & AU_HIMEM_SPACE_SWAP_HW) 711 if (flags & AU_HIMEM_SPACE_SWAP_HW)
712 c->c_hwswap = 1; 712 c->c_hwswap = 1;
713 else 713 else
714 c->c_swswap = 1; 714 c->c_swswap = 1;
715 } 715 }
716 716
717#elif _BYTE_ORDER == _LITTLE_ENDIAN 717#elif _BYTE_ORDER == _LITTLE_ENDIAN

cvs diff -r1.8 -r1.9 src/sys/arch/mips/alchemy/au_wired_space.c (expand / switch to unified diff)

--- src/sys/arch/mips/alchemy/au_wired_space.c 2011/07/10 23:13:23 1.8
+++ src/sys/arch/mips/alchemy/au_wired_space.c 2012/01/27 18:52:58 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: au_wired_space.c,v 1.8 2011/07/10 23:13:23 matt Exp $ */ 1/* $NetBSD: au_wired_space.c,v 1.9 2012/01/27 18:52:58 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Garrett D'Amore for Itronix Inc. 7 * Written by Garrett D'Amore for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 51 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
52 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 52 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
53 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 53 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
54 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 54 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
55 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 55 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
56 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 56 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 57 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 58 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 59 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60 * POSSIBILITY OF SUCH DAMAGE. 60 * POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: au_wired_space.c,v 1.8 2011/07/10 23:13:23 matt Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: au_wired_space.c,v 1.9 2012/01/27 18:52:58 para Exp $");
65 65
66/* 66/*
67 * This provides mappings for the upper I/O regions used on some 67 * This provides mappings for the upper I/O regions used on some
68 * Alchemy parts, e.g. PCI and PCMCIA spaces. These spaces can be 68 * Alchemy parts, e.g. PCI and PCMCIA spaces. These spaces can be
69 * accessed using wired TLB entries. 69 * accessed using wired TLB entries.
70 */ 70 */
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/systm.h> 73#include <sys/systm.h>
74#include <sys/extent.h> 74#include <sys/extent.h>
75#include <sys/malloc.h> 75#include <sys/malloc.h>
76#include <sys/endian.h> 76#include <sys/endian.h>
77 77
@@ -631,27 +631,27 @@ au_wired_space_init(bus_space_tag_t bst, @@ -631,27 +631,27 @@ au_wired_space_init(bus_space_tag_t bst,
631 paddr_t paddr, bus_addr_t start, bus_size_t size, int flags) 631 paddr_t paddr, bus_addr_t start, bus_size_t size, int flags)
632{ 632{
633 au_wired_cookie_t *c; 633 au_wired_cookie_t *c;
634 634
635 c = malloc(sizeof (struct au_wired_cookie), M_DEVBUF, 635 c = malloc(sizeof (struct au_wired_cookie), M_DEVBUF,
636 M_NOWAIT | M_ZERO); 636 M_NOWAIT | M_ZERO);
637 637
638 c->c_pbase = paddr; 638 c->c_pbase = paddr;
639 c->c_name = name; 639 c->c_name = name;
640 c->c_start = start; 640 c->c_start = start;
641 c->c_size = size; 641 c->c_size = size;
642 642
643 /* allocate extent manager */ 643 /* allocate extent manager */
644 c->c_extent = extent_create(name, start, start + size, M_DEVBUF, 644 c->c_extent = extent_create(name, start, start + size,
645 (void *)c->c_exstore, sizeof (c->c_exstore), EX_NOWAIT); 645 (void *)c->c_exstore, sizeof (c->c_exstore), EX_NOWAIT);
646 if (c->c_extent == NULL) 646 if (c->c_extent == NULL)
647 panic("au_wired_space_init: %s: cannot create extent", name); 647 panic("au_wired_space_init: %s: cannot create extent", name);
648 648
649#if _BYTE_ORDER == _BIG_ENDIAN 649#if _BYTE_ORDER == _BIG_ENDIAN
650 if (flags & AU_WIRED_SPACE_LITTLE_ENDIAN) { 650 if (flags & AU_WIRED_SPACE_LITTLE_ENDIAN) {
651 if (flags & AU_WIRED_SPACE_SWAP_HW) 651 if (flags & AU_WIRED_SPACE_SWAP_HW)
652 c->c_hwswap = 1; 652 c->c_hwswap = 1;
653 else 653 else
654 c->c_swswap = 1; 654 c->c_swswap = 1;
655 } 655 }
656 656
657#elif _BYTE_ORDER == _LITTLE_ENDIAN 657#elif _BYTE_ORDER == _LITTLE_ENDIAN

cvs diff -r1.12 -r1.13 src/sys/arch/mips/alchemy/dev/aupci.c (expand / switch to unified diff)

--- src/sys/arch/mips/alchemy/dev/aupci.c 2012/01/03 07:36:02 1.12
+++ src/sys/arch/mips/alchemy/dev/aupci.c 2012/01/27 18:52:58 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: aupci.c,v 1.12 2012/01/03 07:36:02 kiyohara Exp $ */ 1/* $NetBSD: aupci.c,v 1.13 2012/01/27 18:52:58 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006 Itronix Inc. 4 * Copyright (c) 2006 Itronix Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Garrett D'Amore for Itronix Inc. 7 * Written by Garrett D'Amore for Itronix Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN 28 * ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE. 31 * POSSIBILITY OF SUCH DAMAGE.
32 */  32 */
33 33
34#include "opt_pci.h" 34#include "opt_pci.h"
35#include "pci.h" 35#include "pci.h"
36 36
37#include <sys/cdefs.h> 37#include <sys/cdefs.h>
38__KERNEL_RCSID(0, "$NetBSD: aupci.c,v 1.12 2012/01/03 07:36:02 kiyohara Exp $"); 38__KERNEL_RCSID(0, "$NetBSD: aupci.c,v 1.13 2012/01/27 18:52:58 para Exp $");
39 39
40#include <sys/types.h> 40#include <sys/types.h>
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/time.h> 42#include <sys/time.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/errno.h> 44#include <sys/errno.h>
45#include <sys/device.h> 45#include <sys/device.h>
46#include <sys/malloc.h> 46#include <sys/malloc.h>
47#include <sys/extent.h> 47#include <sys/extent.h>
48 48
49#include <uvm/uvm_extern.h> 49#include <uvm/uvm_extern.h>
50 50
51#include <sys/bus.h> 51#include <sys/bus.h>
@@ -249,30 +249,30 @@ aupciattach(device_t parent, device_t se @@ -249,30 +249,30 @@ aupciattach(device_t parent, device_t se
249 sc->sc_pc.pc_decompose_tag = aupci_decompose_tag; 249 sc->sc_pc.pc_decompose_tag = aupci_decompose_tag;
250 sc->sc_pc.pc_conf_read = aupci_conf_read; 250 sc->sc_pc.pc_conf_read = aupci_conf_read;
251 sc->sc_pc.pc_conf_write = aupci_conf_write; 251 sc->sc_pc.pc_conf_write = aupci_conf_write;
252 252
253 sc->sc_pc.pc_intr_v = sc; 253 sc->sc_pc.pc_intr_v = sc;
254 sc->sc_pc.pc_intr_map = aupci_intr_map; 254 sc->sc_pc.pc_intr_map = aupci_intr_map;
255 sc->sc_pc.pc_intr_string = aupci_intr_string; 255 sc->sc_pc.pc_intr_string = aupci_intr_string;
256 sc->sc_pc.pc_intr_establish = aupci_intr_establish; 256 sc->sc_pc.pc_intr_establish = aupci_intr_establish;
257 sc->sc_pc.pc_intr_disestablish = aupci_intr_disestablish; 257 sc->sc_pc.pc_intr_disestablish = aupci_intr_disestablish;
258 sc->sc_pc.pc_conf_interrupt = aupci_conf_interrupt; 258 sc->sc_pc.pc_conf_interrupt = aupci_conf_interrupt;
259 259
260#ifdef PCI_NETBSD_CONFIGURE 260#ifdef PCI_NETBSD_CONFIGURE
261 mem_ex = extent_create("pcimem", mstart, 0xffffffff, 261 mem_ex = extent_create("pcimem", mstart, 0xffffffff,
262 M_DEVBUF, NULL, 0, EX_WAITOK); 262 NULL, 0, EX_WAITOK);
263 263
264 io_ex = extent_create("pciio", AUPCI_IO_START, AUPCI_IO_END, 264 io_ex = extent_create("pciio", AUPCI_IO_START, AUPCI_IO_END,
265 M_DEVBUF, NULL, 0, EX_WAITOK); 265 NULL, 0, EX_WAITOK);
266 266
267 pci_configure_bus(&sc->sc_pc, 267 pci_configure_bus(&sc->sc_pc,
268 io_ex, mem_ex, NULL, 0, mips_cache_info.mci_dcache_align); 268 io_ex, mem_ex, NULL, 0, mips_cache_info.mci_dcache_align);
269 extent_destroy(mem_ex); 269 extent_destroy(mem_ex);
270 extent_destroy(io_ex); 270 extent_destroy(io_ex);
271#endif 271#endif
272 272
273 pba.pba_iot = sc->sc_iot; 273 pba.pba_iot = sc->sc_iot;
274 pba.pba_memt = sc->sc_memt; 274 pba.pba_memt = sc->sc_memt;
275 /* XXX: review dma tag logic */ 275 /* XXX: review dma tag logic */
276 pba.pba_dmat = aa->aa_dt; 276 pba.pba_dmat = aa->aa_dt;
277 pba.pba_dmat64 = NULL; 277 pba.pba_dmat64 = NULL;
278 pba.pba_pc = &sc->sc_pc; 278 pba.pba_pc = &sc->sc_pc;

cvs diff -r1.18 -r1.19 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c (expand / switch to unified diff)

--- src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c 2011/09/23 12:42:15 1.18
+++ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c 2012/01/27 18:52:58 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.18 2011/09/23 12:42:15 macallan Exp $ */ 1/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.19 2012/01/27 18:52:58 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -71,27 +71,27 @@ @@ -71,27 +71,27 @@
71 * declared. 71 * declared.
72 * CHIP_EX_STORE_SIZE 72 * CHIP_EX_STORE_SIZE
73 * Size of the device-provided static storage area 73 * Size of the device-provided static storage area
74 * for the memory or I/O memory space extent. 74 * for the memory or I/O memory space extent.
75 * CHIP_LITTLE_ENDIAN | CHIP_BIG_ENDIAN 75 * CHIP_LITTLE_ENDIAN | CHIP_BIG_ENDIAN
76 * For endian-specific busses, like PCI (little). 76 * For endian-specific busses, like PCI (little).
77 * CHIP_ACCESS_SIZE 77 * CHIP_ACCESS_SIZE
78 * Size (in bytes) of minimum bus access, e.g. 4 78 * Size (in bytes) of minimum bus access, e.g. 4
79 * to indicate all bus cycles are 32-bits. Defaults 79 * to indicate all bus cycles are 32-bits. Defaults
80 * to 1, indicating any access size is valid. 80 * to 1, indicating any access size is valid.
81 */ 81 */
82 82
83#include <sys/cdefs.h> 83#include <sys/cdefs.h>
84__KERNEL_RCSID(0, "$NetBSD: bus_space_alignstride_chipdep.c,v 1.18 2011/09/23 12:42:15 macallan Exp $"); 84__KERNEL_RCSID(0, "$NetBSD: bus_space_alignstride_chipdep.c,v 1.19 2012/01/27 18:52:58 para Exp $");
85 85
86#ifdef CHIP_EXTENT 86#ifdef CHIP_EXTENT
87#include <sys/extent.h> 87#include <sys/extent.h>
88#endif 88#endif
89#include <sys/malloc.h> 89#include <sys/malloc.h>
90 90
91#include <mips/locore.h> 91#include <mips/locore.h>
92 92
93#include <uvm/uvm_extern.h> 93#include <uvm/uvm_extern.h>
94 94
95#define __C(A,B) __CONCAT(A,B) 95#define __C(A,B) __CONCAT(A,B)
96#define __S(S) __STRING(S) 96#define __S(S) __STRING(S)
97 97
@@ -1246,27 +1246,27 @@ __BS(init)(bus_space_tag_t t, void *v) @@ -1246,27 +1246,27 @@ __BS(init)(bus_space_tag_t t, void *v)
1246 t->bs_wms_2 = __BS(write_multi_2); 1246 t->bs_wms_2 = __BS(write_multi_2);
1247 t->bs_wms_4 = __BS(write_multi_4); 1247 t->bs_wms_4 = __BS(write_multi_4);
1248 t->bs_wms_8 = __BS(write_multi_8); 1248 t->bs_wms_8 = __BS(write_multi_8);
1249  1249
1250 /* write region, stream */ 1250 /* write region, stream */
1251 t->bs_wrs_1 = __BS(write_region_1); 1251 t->bs_wrs_1 = __BS(write_region_1);
1252 t->bs_wrs_2 = __BS(write_region_2); 1252 t->bs_wrs_2 = __BS(write_region_2);
1253 t->bs_wrs_4 = __BS(write_region_4); 1253 t->bs_wrs_4 = __BS(write_region_4);
1254 t->bs_wrs_8 = __BS(write_region_8); 1254 t->bs_wrs_8 = __BS(write_region_8);
1255#endif /* CHIP_NEED_STREAM */ 1255#endif /* CHIP_NEED_STREAM */
1256 1256
1257#ifdef CHIP_EXTENT 1257#ifdef CHIP_EXTENT
1258 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */ 1258 /* XXX WE WANT EXTENT_NOCOALESCE, BUT WE CAN'T USE IT. XXX */
1259 ex = extent_create(__S(__BS(bus)), 0x0UL, ~0UL, M_DEVBUF, 1259 ex = extent_create(__S(__BS(bus)), 0x0UL, ~0UL,
1260 (void *)CHIP_EX_STORE(v), CHIP_EX_STORE_SIZE(v), EX_NOWAIT); 1260 (void *)CHIP_EX_STORE(v), CHIP_EX_STORE_SIZE(v), EX_NOWAIT);
1261 extent_alloc_region(ex, 0, ~0UL, EX_NOWAIT); 1261 extent_alloc_region(ex, 0, ~0UL, EX_NOWAIT);
1262 1262
1263#ifdef CHIP_W1_BUS_START 1263#ifdef CHIP_W1_BUS_START
1264 /* 1264 /*
1265 * The window may be disabled. We notice this by seeing 1265 * The window may be disabled. We notice this by seeing
1266 * -1 as the bus base address. 1266 * -1 as the bus base address.
1267 */ 1267 */
1268 if (CHIP_W1_BUS_START(v) == (bus_addr_t) -1) { 1268 if (CHIP_W1_BUS_START(v) == (bus_addr_t) -1) {
1269#ifdef EXTENT_DEBUG 1269#ifdef EXTENT_DEBUG
1270 printf("%s: this space is disabled\n", __S(__BS(init))); 1270 printf("%s: this space is disabled\n", __S(__BS(init)));
1271#endif 1271#endif
1272 return; 1272 return;

cvs diff -r1.8 -r1.9 src/sys/arch/mips/rmi/rmixl_pcie.c (expand / switch to unified diff)

--- src/sys/arch/mips/rmi/rmixl_pcie.c 2011/07/10 23:13:22 1.8
+++ src/sys/arch/mips/rmi/rmixl_pcie.c 2012/01/27 18:52:58 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rmixl_pcie.c,v 1.8 2011/07/10 23:13:22 matt Exp $ */ 1/* $NetBSD: rmixl_pcie.c,v 1.9 2012/01/27 18:52:58 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wasabi Systems, Inc. 4 * Copyright (c) 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38/* 38/*
39 * PCI configuration support for RMI XLS SoC 39 * PCI configuration support for RMI XLS SoC
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: rmixl_pcie.c,v 1.8 2011/07/10 23:13:22 matt Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: rmixl_pcie.c,v 1.9 2012/01/27 18:52:58 para Exp $");
44 44
45#include "opt_pci.h" 45#include "opt_pci.h"
46#include "pci.h" 46#include "pci.h"
47 47
48#include <sys/cdefs.h> 48#include <sys/cdefs.h>
49 49
50#include <sys/param.h> 50#include <sys/param.h>
51#include <sys/bus.h> 51#include <sys/bus.h>
52#include <sys/cpu.h> 52#include <sys/cpu.h>
53#include <sys/device.h> 53#include <sys/device.h>
54#include <sys/extent.h> 54#include <sys/extent.h>
55#include <sys/intr.h> 55#include <sys/intr.h>
56#include <sys/kernel.h> /* for 'hz' */ 56#include <sys/kernel.h> /* for 'hz' */
@@ -693,32 +693,32 @@ rmixl_pcie_init(struct rmixl_pcie_softc  @@ -693,32 +693,32 @@ rmixl_pcie_init(struct rmixl_pcie_softc
693 693
694#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE) 694#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE)
695 /* 695 /*
696 * Configure the PCI bus. 696 * Configure the PCI bus.
697 */ 697 */
698 struct rmixl_config *rcp = &rmixl_configuration; 698 struct rmixl_config *rcp = &rmixl_configuration;
699 699
700 aprint_normal("%s: configuring PCI bus\n", 700 aprint_normal("%s: configuring PCI bus\n",
701 device_xname(sc->sc_dev)); 701 device_xname(sc->sc_dev));
702 702
703 ioext = extent_create("pciio", 703 ioext = extent_create("pciio",
704 rcp->rc_pci_io_pbase, 704 rcp->rc_pci_io_pbase,
705 rcp->rc_pci_io_pbase + rcp->rc_pci_io_size - 1, 705 rcp->rc_pci_io_pbase + rcp->rc_pci_io_size - 1,
706 M_DEVBUF, NULL, 0, EX_NOWAIT); 706 NULL, 0, EX_NOWAIT);
707 707
708 memext = extent_create("pcimem", 708 memext = extent_create("pcimem",
709 rcp->rc_pci_mem_pbase, 709 rcp->rc_pci_mem_pbase,
710 rcp->rc_pci_mem_pbase + rcp->rc_pci_mem_size - 1, 710 rcp->rc_pci_mem_pbase + rcp->rc_pci_mem_size - 1,
711 M_DEVBUF, NULL, 0, EX_NOWAIT); 711 NULL, 0, EX_NOWAIT);
712 712
713 pci_configure_bus(pc, ioext, memext, NULL, 0, 713 pci_configure_bus(pc, ioext, memext, NULL, 0,
714 mips_cache_info.mci_dcache_align); 714 mips_cache_info.mci_dcache_align);
715 715
716 extent_destroy(ioext); 716 extent_destroy(ioext);
717 extent_destroy(memext); 717 extent_destroy(memext);
718#endif 718#endif
719} 719}
720 720
721static void 721static void
722rmixl_pcie_init_ecfg(struct rmixl_pcie_softc *sc) 722rmixl_pcie_init_ecfg(struct rmixl_pcie_softc *sc)
723{ 723{
724 void *v; 724 void *v;

cvs diff -r1.11 -r1.12 src/sys/arch/mipsco/mipsco/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/mipsco/mipsco/bus_space.c 2009/03/18 10:22:32 1.11
+++ src/sys/arch/mipsco/mipsco/bus_space.c 2012/01/27 18:52:59 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.11 2009/03/18 10:22:32 cegger Exp $ */ 1/* $NetBSD: bus_space.c,v 1.12 2012/01/27 18:52:59 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace 8 * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace
9 * Simulation Facility, NASA Ames Research Center. 9 * Simulation Facility, NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.11 2009/03/18 10:22:32 cegger Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.12 2012/01/27 18:52:59 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/extent.h> 39#include <sys/extent.h>
40 40
41#include <uvm/uvm_extern.h> 41#include <uvm/uvm_extern.h>
42 42
43#include <machine/bus.h> 43#include <machine/bus.h>
44 44
45void 45void
46mipsco_bus_space_init(bus_space_tag_t bst, const char *name, paddr_t paddr, vaddr_t vaddr, bus_addr_t start, bus_size_t size) 46mipsco_bus_space_init(bus_space_tag_t bst, const char *name, paddr_t paddr, vaddr_t vaddr, bus_addr_t start, bus_size_t size)
47{ 47{
@@ -59,27 +59,27 @@ mipsco_bus_space_init(bus_space_tag_t bs @@ -59,27 +59,27 @@ mipsco_bus_space_init(bus_space_tag_t bs
59 bst->bs_subregion = mipsco_bus_space_subregion; 59 bst->bs_subregion = mipsco_bus_space_subregion;
60 bst->bs_mmap = mipsco_bus_space_mmap; 60 bst->bs_mmap = mipsco_bus_space_mmap;
61 bst->bs_alloc = mipsco_bus_space_alloc; 61 bst->bs_alloc = mipsco_bus_space_alloc;
62 bst->bs_free = mipsco_bus_space_free; 62 bst->bs_free = mipsco_bus_space_free;
63 bst->bs_aux = NULL; 63 bst->bs_aux = NULL;
64 bst->bs_bswap = 0; /* No byte swap for stream methods */ 64 bst->bs_bswap = 0; /* No byte swap for stream methods */
65 mipsco_bus_space_set_aligned_stride(bst, 0); 65 mipsco_bus_space_set_aligned_stride(bst, 0);
66} 66}
67 67
68void 68void
69mipsco_bus_space_init_extent(bus_space_tag_t bst, void *storage, size_t storagesize) 69mipsco_bus_space_init_extent(bus_space_tag_t bst, void *storage, size_t storagesize)
70{ 70{
71 bst->bs_extent = extent_create(bst->bs_name, 71 bst->bs_extent = extent_create(bst->bs_name,
72 bst->bs_start, bst->bs_start + bst->bs_size, M_DEVBUF, 72 bst->bs_start, bst->bs_start + bst->bs_size,
73 storage, storagesize, EX_NOWAIT); 73 storage, storagesize, EX_NOWAIT);
74 if (bst->bs_extent == NULL) 74 if (bst->bs_extent == NULL)
75 panic("mipsco_bus_space_init_extent: cannot create extent map %s", 75 panic("mipsco_bus_space_init_extent: cannot create extent map %s",
76 bst->bs_name); 76 bst->bs_name);
77} 77}
78 78
79void 79void
80mipsco_bus_space_set_aligned_stride(bus_space_tag_t bst, unsigned int shift) 80mipsco_bus_space_set_aligned_stride(bus_space_tag_t bst, unsigned int shift)
81 /* shift: log2(alignment) */ 81 /* shift: log2(alignment) */
82{ 82{
83 bst->bs_stride = shift; 83 bst->bs_stride = shift;
84 84
85 if (shift == 2) { /* XXX Assumes Big Endian & 4B */ 85 if (shift == 2) { /* XXX Assumes Big Endian & 4B */

cvs diff -r1.14 -r1.15 src/sys/arch/mvmeppc/mvmeppc/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/mvmeppc/mvmeppc/mainbus.c 2011/07/01 20:49:38 1.14
+++ src/sys/arch/mvmeppc/mvmeppc/mainbus.c 2012/01/27 18:52:59 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.14 2011/07/01 20:49:38 dyoung Exp $ */ 1/* $NetBSD: mainbus.c,v 1.15 2012/01/27 18:52:59 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.14 2011/07/01 20:49:38 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15 2012/01/27 18:52:59 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/extent.h> 37#include <sys/extent.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41 41
42#include <machine/autoconf.h> 42#include <machine/autoconf.h>
43#include <sys/bus.h> 43#include <sys/bus.h>
44 44
45#include "pci.h" 45#include "pci.h"
46#include "opt_pci.h" 46#include "opt_pci.h"
47#include <dev/pci/pcivar.h> 47#include <dev/pci/pcivar.h>
@@ -108,29 +108,29 @@ mainbus_attach(device_t parent, device_t @@ -108,29 +108,29 @@ mainbus_attach(device_t parent, device_t
108 KASSERT(genppc_pct != NULL); 108 KASSERT(genppc_pct != NULL);
109 mvmeppc_pci_get_chipset_tag(genppc_pct); 109 mvmeppc_pci_get_chipset_tag(genppc_pct);
110 110
111 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), 111 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
112 M_DEVBUF, M_NOWAIT); 112 M_DEVBUF, M_NOWAIT);
113 KASSERT(pbi != NULL); 113 KASSERT(pbi != NULL);
114 pbi->pbi_properties = prop_dictionary_create(); 114 pbi->pbi_properties = prop_dictionary_create();
115 KASSERT(pbi->pbi_properties != NULL); 115 KASSERT(pbi->pbi_properties != NULL);
116 116
117 SIMPLEQ_INIT(&genppc_pct->pc_pbi); 117 SIMPLEQ_INIT(&genppc_pct->pc_pbi);
118 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next); 118 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next);
119 119
120#ifdef PCI_NETBSD_CONFIGURE 120#ifdef PCI_NETBSD_CONFIGURE
121 ioext = extent_create("pciio", 0x00008000, 0x0000ffff, M_DEVBUF, 121 ioext = extent_create("pciio", 0x00008000, 0x0000ffff,
122 NULL, 0, EX_NOWAIT); 122 NULL, 0, EX_NOWAIT);
123 memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF, 123 memext = extent_create("pcimem", 0x00000000, 0x0fffffff,
124 NULL, 0, EX_NOWAIT); 124 NULL, 0, EX_NOWAIT);
125 125
126 pci_configure_bus(0, ioext, memext, NULL, 0, 32); 126 pci_configure_bus(0, ioext, memext, NULL, 0, 32);
127 127
128 extent_destroy(ioext); 128 extent_destroy(ioext);
129 extent_destroy(memext); 129 extent_destroy(memext);
130#endif 130#endif
131 131
132 pba.pba_iot = &prep_io_space_tag; 132 pba.pba_iot = &prep_io_space_tag;
133 pba.pba_memt = &prep_mem_space_tag; 133 pba.pba_memt = &prep_mem_space_tag;
134 pba.pba_dmat = &pci_bus_dma_tag; 134 pba.pba_dmat = &pci_bus_dma_tag;
135 pba.pba_dmat64 = NULL; 135 pba.pba_dmat64 = NULL;
136 pba.pba_pc = genppc_pct; 136 pba.pba_pc = genppc_pct;

cvs diff -r1.10 -r1.11 src/sys/arch/ofppc/pci/ofwpci.c (expand / switch to unified diff)

--- src/sys/arch/ofppc/pci/ofwpci.c 2011/06/18 08:08:29 1.10
+++ src/sys/arch/ofppc/pci/ofwpci.c 2012/01/27 18:52:59 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ofwpci.c,v 1.10 2011/06/18 08:08:29 matt Exp $ */ 1/* $NetBSD: ofwpci.c,v 1.11 2012/01/27 18:52:59 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Tim Rightnour 8 * by Tim Rightnour
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: ofwpci.c,v 1.10 2011/06/18 08:08:29 matt Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: ofwpci.c,v 1.11 2012/01/27 18:52:59 para Exp $");
34 34
35#include "opt_pci.h" 35#include "opt_pci.h"
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40#include <sys/extent.h> 40#include <sys/extent.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42 42
43#include <dev/pci/pcivar.h> 43#include <dev/pci/pcivar.h>
44#include <dev/pci/pciconf.h> 44#include <dev/pci/pciconf.h>
45#include <dev/ofw/openfirm.h> 45#include <dev/ofw/openfirm.h>
46#include <dev/ofw/ofw_pci.h> 46#include <dev/ofw/ofw_pci.h>
@@ -192,29 +192,29 @@ ofwpci_attach(device_t parent, device_t  @@ -192,29 +192,29 @@ ofwpci_attach(device_t parent, device_t
192 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), 192 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
193 M_DEVBUF, M_NOWAIT); 193 M_DEVBUF, M_NOWAIT);
194 KASSERT(pbi != NULL); 194 KASSERT(pbi != NULL);
195 pbi->pbi_properties = prop_dictionary_create(); 195 pbi->pbi_properties = prop_dictionary_create();
196 KASSERT(pbi->pbi_properties != NULL); 196 KASSERT(pbi->pbi_properties != NULL);
197 SIMPLEQ_INIT(&pc->pc_pbi); 197 SIMPLEQ_INIT(&pc->pc_pbi);
198 SIMPLEQ_INSERT_TAIL(&pc->pc_pbi, pbi, next); 198 SIMPLEQ_INSERT_TAIL(&pc->pc_pbi, pbi, next);
199 199
200 genofw_setup_pciintr_map((void *)pc, pbi, pc->pc_node); 200 genofw_setup_pciintr_map((void *)pc, pbi, pc->pc_node);
201#ifdef PCI_NETBSD_CONFIGURE 201#ifdef PCI_NETBSD_CONFIGURE
202 ioext = extent_create("pciio", 202 ioext = extent_create("pciio",
203 modeldata.pciiodata[device_unit(self)].start, 203 modeldata.pciiodata[device_unit(self)].start,
204 modeldata.pciiodata[device_unit(self)].limit, 204 modeldata.pciiodata[device_unit(self)].limit,
205 M_DEVBUF, NULL, 0, EX_NOWAIT); 205 NULL, 0, EX_NOWAIT);
206 memext = extent_create("pcimem", sc->sc_memt.pbs_base, 206 memext = extent_create("pcimem", sc->sc_memt.pbs_base,
207 sc->sc_memt.pbs_limit-1, M_DEVBUF, NULL, 0, EX_NOWAIT); 207 sc->sc_memt.pbs_limit-1, NULL, 0, EX_NOWAIT);
208 208
209 if (pci_configure_bus(pc, ioext, memext, NULL, 0, CACHELINESIZE)) 209 if (pci_configure_bus(pc, ioext, memext, NULL, 0, CACHELINESIZE))
210 aprint_error("pci_configure_bus() failed\n"); 210 aprint_error("pci_configure_bus() failed\n");
211 211
212 extent_destroy(ioext); 212 extent_destroy(ioext);
213 extent_destroy(memext); 213 extent_destroy(memext);
214#endif /* PCI_NETBSD_CONFIGURE */ 214#endif /* PCI_NETBSD_CONFIGURE */
215 memset(&pba, 0, sizeof(pba)); 215 memset(&pba, 0, sizeof(pba));
216 pba.pba_memt = pc->pc_memt; 216 pba.pba_memt = pc->pc_memt;
217 pba.pba_iot = pc->pc_iot; 217 pba.pba_iot = pc->pc_iot;
218 pba.pba_dmat = &pci_bus_dma_tag; 218 pba.pba_dmat = &pci_bus_dma_tag;
219 pba.pba_dmat64 = NULL; 219 pba.pba_dmat64 = NULL;
220 pba.pba_bus = pc->pc_bus; 220 pba.pba_bus = pc->pc_bus;

cvs diff -r1.11 -r1.12 src/sys/arch/powerpc/booke/pci/pq3pci.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/booke/pci/pq3pci.c 2011/09/27 01:02:35 1.11
+++ src/sys/arch/powerpc/booke/pci/pq3pci.c 2012/01/27 18:52:59 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pq3pci.c,v 1.11 2011/09/27 01:02:35 jym Exp $ */ 1/* $NetBSD: pq3pci.c,v 1.12 2012/01/27 18:52:59 para Exp $ */
2/*- 2/*-
3 * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. 3 * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects 7 * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects
8 * Agency and which was developed by Matt Thomas of 3am Software Foundry. 8 * Agency and which was developed by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * This material is based upon work supported by the Defense Advanced Research 10 * This material is based upon work supported by the Defense Advanced Research
11 * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under 11 * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
12 * Contract No. N66001-09-C-2073. 12 * Contract No. N66001-09-C-2073.
13 * Approved for Public Release, Distribution Unlimited 13 * Approved for Public Release, Distribution Unlimited
14 * 14 *
@@ -34,27 +34,27 @@ @@ -34,27 +34,27 @@
34 * POSSIBILITY OF SUCH DAMAGE. 34 * POSSIBILITY OF SUCH DAMAGE.
35 */ 35 */
36 36
37#define PCI_PRIVATE 37#define PCI_PRIVATE
38#define GLOBAL_PRIVATE 38#define GLOBAL_PRIVATE
39#define __INTR_PRIVATE 39#define __INTR_PRIVATE
40 40
41#include "opt_mpc85xx.h" 41#include "opt_mpc85xx.h"
42#include "opt_pci.h" 42#include "opt_pci.h"
43#include "locators.h" 43#include "locators.h"
44 44
45#include <sys/cdefs.h> 45#include <sys/cdefs.h>
46 46
47__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.11 2011/09/27 01:02:35 jym Exp $"); 47__KERNEL_RCSID(0, "$NetBSD: pq3pci.c,v 1.12 2012/01/27 18:52:59 para Exp $");
48 48
49#include <sys/param.h> 49#include <sys/param.h>
50#include <sys/device.h> 50#include <sys/device.h>
51#include <sys/cpu.h> 51#include <sys/cpu.h>
52#include <sys/intr.h> 52#include <sys/intr.h>
53#include <sys/bus.h> 53#include <sys/bus.h>
54#include <sys/extent.h> 54#include <sys/extent.h>
55#include <sys/bitops.h> 55#include <sys/bitops.h>
56#include <sys/kmem.h> 56#include <sys/kmem.h>
57#include <sys/malloc.h> /* for extent */ 57#include <sys/malloc.h> /* for extent */
58 58
59#include <dev/pci/pcireg.h> 59#include <dev/pci/pcireg.h>
60#include <dev/pci/pcivar.h> 60#include <dev/pci/pcivar.h>
@@ -848,29 +848,29 @@ pq3pci_cpunode_attach(device_t parent, d @@ -848,29 +848,29 @@ pq3pci_cpunode_attach(device_t parent, d
848 }; 848 };
849 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOTAR2, owin2.potar); 849 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOTAR2, owin2.potar);
850 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOTEAR2, owin2.potear); 850 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOTEAR2, owin2.potear);
851 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOWBAR2, owin2.powbar); 851 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOWBAR2, owin2.powbar);
852 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOWAR2, owin2.powar); 852 bus_space_write_4(sc->sc_bst, sc->sc_bsh, PEXOWAR2, owin2.powar);
853 if (!pq3pci_owin_setup(sc, 2, &owin2)) { 853 if (!pq3pci_owin_setup(sc, 2, &owin2)) {
854 aprint_error( 854 aprint_error(
855 ": error creating bus space for %s\n", 855 ": error creating bus space for %s\n",
856 "PCI I/O space"); 856 "PCI I/O space");
857 return; 857 return;
858 } 858 }
859 859
860 struct extent *ioext = extent_create("pciio", 0, PCI_IOSIZE, 860 struct extent *ioext = extent_create("pciio", 0, PCI_IOSIZE,
861 M_DEVBUF, NULL, 0, EX_NOWAIT); 861 NULL, 0, EX_NOWAIT);
862 struct extent *memext = extent_create("pcimem", membase, 862 struct extent *memext = extent_create("pcimem", membase,
863 membase + PCI_MEMSIZE, M_DEVBUF, NULL, 0, EX_NOWAIT); 863 membase + PCI_MEMSIZE, NULL, 0, EX_NOWAIT);
864 864
865 error = pci_configure_bus(pc, ioext, memext, NULL, 0, 865 error = pci_configure_bus(pc, ioext, memext, NULL, 0,
866 curcpu()->ci_ci.dcache_line_size); 866 curcpu()->ci_ci.dcache_line_size);
867 867
868 extent_destroy(ioext); 868 extent_destroy(ioext);
869 extent_destroy(memext); 869 extent_destroy(memext);
870 870
871 if (error) { 871 if (error) {
872 aprint_normal(": configuration failed\n"); 872 aprint_normal(": configuration failed\n");
873 return; 873 return;
874 } 874 }
875 } 875 }
876#endif 876#endif

cvs diff -r1.10 -r1.11 src/sys/arch/powerpc/ibm4xx/pci/pchb.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/ibm4xx/pci/pchb.c 2011/06/22 18:06:34 1.10
+++ src/sys/arch/powerpc/ibm4xx/pci/pchb.c 2012/01/27 18:53:00 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pchb.c,v 1.10 2011/06/22 18:06:34 matt Exp $ */ 1/* $NetBSD: pchb.c,v 1.11 2012/01/27 18:53:00 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.10 2011/06/22 18:06:34 matt Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.11 2012/01/27 18:53:00 para Exp $");
33 33
34#include "pci.h" 34#include "pci.h"
35#include "opt_pci.h" 35#include "opt_pci.h"
36 36
37#include <sys/types.h> 37#include <sys/types.h>
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43 43
44#define _IBM4XX_BUS_DMA_PRIVATE 44#define _IBM4XX_BUS_DMA_PRIVATE
45 45
@@ -151,31 +151,31 @@ pchbattach(device_t parent, device_t sel @@ -151,31 +151,31 @@ pchbattach(device_t parent, device_t sel
151 ibm4xx_setup_pci(); 151 ibm4xx_setup_pci();
152#ifdef PCI_CONFIGURE_VERBOSE 152#ifdef PCI_CONFIGURE_VERBOSE
153 ibm4xx_show_pci_map(); 153 ibm4xx_show_pci_map();
154#endif 154#endif
155 155
156 if (bus_space_init(&pchb_io_tag, "pchbio", NULL, 0)) 156 if (bus_space_init(&pchb_io_tag, "pchbio", NULL, 0))
157 panic("pchbattach: can't init IO tag"); 157 panic("pchbattach: can't init IO tag");
158 if (bus_space_init(&pchb_mem_tag, "pchbmem", NULL, 0)) 158 if (bus_space_init(&pchb_mem_tag, "pchbmem", NULL, 0))
159 panic("pchbattach: can't init MEM tag"); 159 panic("pchbattach: can't init MEM tag");
160 160
161#ifdef PCI_NETBSD_CONFIGURE 161#ifdef PCI_NETBSD_CONFIGURE
162 struct extent *memext = extent_create("pcimem", 162 struct extent *memext = extent_create("pcimem",
163 IBM405GP_PCI_MEM_START, 163 IBM405GP_PCI_MEM_START,
164 IBM405GP_PCI_MEM_START + 0x1fffffff, M_DEVBUF, NULL, 0, 164 IBM405GP_PCI_MEM_START + 0x1fffffff, NULL, 0,
165 EX_NOWAIT); 165 EX_NOWAIT);
166 struct extent *ioext = extent_create("pciio", 166 struct extent *ioext = extent_create("pciio",
167 IBM405GP_PCI_PCI_IO_START, 167 IBM405GP_PCI_PCI_IO_START,
168 IBM405GP_PCI_PCI_IO_START + 0xffff, M_DEVBUF, NULL, 0, EX_NOWAIT); 168 IBM405GP_PCI_PCI_IO_START + 0xffff, NULL, 0, EX_NOWAIT);
169 pci_configure_bus(pc, ioext, memext, NULL, 0, 32); 169 pci_configure_bus(pc, ioext, memext, NULL, 0, 32);
170 extent_destroy(ioext); 170 extent_destroy(ioext);
171 extent_destroy(memext); 171 extent_destroy(memext);
172#endif /* PCI_NETBSD_CONFIGURE */ 172#endif /* PCI_NETBSD_CONFIGURE */
173 173
174#ifdef PCI_CONFIGURE_VERBOSE 174#ifdef PCI_CONFIGURE_VERBOSE
175 printf("running config_found PCI\n"); 175 printf("running config_found PCI\n");
176#endif 176#endif
177 /* IO window located @ e8000000 and maps to 0-0xffff */ 177 /* IO window located @ e8000000 and maps to 0-0xffff */
178 pba.pba_iot = &pchb_io_tag; 178 pba.pba_iot = &pchb_io_tag;
179 /* PCI memory window is directly mapped */ 179 /* PCI memory window is directly mapped */
180 pba.pba_memt = &pchb_mem_tag; 180 pba.pba_memt = &pchb_mem_tag;
181 pba.pba_dmat = paa->plb_dmat; 181 pba.pba_dmat = paa->plb_dmat;

cvs diff -r1.29 -r1.30 src/sys/arch/powerpc/powerpc/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/powerpc/bus_space.c 2011/12/17 19:34:07 1.29
+++ src/sys/arch/powerpc/powerpc/bus_space.c 2012/01/27 18:53:00 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.29 2011/12/17 19:34:07 phx Exp $ */ 1/* $NetBSD: bus_space.c,v 1.30 2012/01/27 18:53:00 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.29 2011/12/17 19:34:07 phx Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.30 2012/01/27 18:53:00 para Exp $");
35 35
36#define _POWERPC_BUS_SPACE_PRIVATE 36#define _POWERPC_BUS_SPACE_PRIVATE
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/endian.h> 42#include <sys/endian.h>
43#include <sys/extent.h> 43#include <sys/extent.h>
44#include <sys/malloc.h> 44#include <sys/malloc.h>
45#include <sys/bus.h> 45#include <sys/bus.h>
46 46
47#include <uvm/uvm.h> 47#include <uvm/uvm.h>
@@ -391,27 +391,27 @@ static int memio_subregion(bus_space_tag @@ -391,27 +391,27 @@ static int memio_subregion(bus_space_tag
391static void memio_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t); 391static void memio_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
392static int memio_alloc(bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t, 392static int memio_alloc(bus_space_tag_t, bus_addr_t, bus_addr_t, bus_size_t,
393 bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); 393 bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
394static void memio_free(bus_space_tag_t, bus_space_handle_t, bus_size_t); 394static void memio_free(bus_space_tag_t, bus_space_handle_t, bus_size_t);
395 395
396static int extent_flags; 396static int extent_flags;
397 397
398int 398int
399bus_space_init(struct powerpc_bus_space *t, const char *extent_name, 399bus_space_init(struct powerpc_bus_space *t, const char *extent_name,
400 void *storage, size_t storage_size) 400 void *storage, size_t storage_size)
401{ 401{
402 if (t->pbs_extent == NULL && extent_name != NULL) { 402 if (t->pbs_extent == NULL && extent_name != NULL) {
403 t->pbs_extent = extent_create(extent_name, t->pbs_base, 403 t->pbs_extent = extent_create(extent_name, t->pbs_base,
404 t->pbs_limit-1, M_DEVBUF, storage, storage_size, 404 t->pbs_limit-1, storage, storage_size,
405 EX_NOCOALESCE|EX_NOWAIT); 405 EX_NOCOALESCE|EX_NOWAIT);
406 if (t->pbs_extent == NULL) 406 if (t->pbs_extent == NULL)
407 return ENOMEM; 407 return ENOMEM;
408 } 408 }
409 409
410 t->pbs_mmap = memio_mmap; 410 t->pbs_mmap = memio_mmap;
411 t->pbs_map = memio_map; 411 t->pbs_map = memio_map;
412 t->pbs_subregion = memio_subregion; 412 t->pbs_subregion = memio_subregion;
413 t->pbs_unmap = memio_unmap; 413 t->pbs_unmap = memio_unmap;
414 t->pbs_alloc = memio_alloc; 414 t->pbs_alloc = memio_alloc;
415 t->pbs_free = memio_free; 415 t->pbs_free = memio_free;
416 416
417 if (t->pbs_flags & _BUS_SPACE_STRIDE_MASK) { 417 if (t->pbs_flags & _BUS_SPACE_STRIDE_MASK) {

cvs diff -r1.32 -r1.33 src/sys/arch/prep/prep/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/prep/prep/mainbus.c 2011/07/01 20:52:02 1.32
+++ src/sys/arch/prep/prep/mainbus.c 2012/01/27 18:53:00 1.33
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.32 2011/07/01 20:52:02 dyoung Exp $ */ 1/* $NetBSD: mainbus.c,v 1.33 2012/01/27 18:53:00 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.32 2011/07/01 20:52:02 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.33 2012/01/27 18:53:00 para Exp $");
35 35
36#include "opt_pci.h" 36#include "opt_pci.h"
37#include "opt_residual.h" 37#include "opt_residual.h"
38 38
39#include "pnpbus.h" 39#include "pnpbus.h"
40#include "pci.h" 40#include "pci.h"
41#include "isa.h" 41#include "isa.h"
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/extent.h> 44#include <sys/extent.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/malloc.h> 47#include <sys/malloc.h>
@@ -134,29 +134,29 @@ mainbus_attach(device_t parent, device_t @@ -134,29 +134,29 @@ mainbus_attach(device_t parent, device_t
134 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), 134 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
135 M_DEVBUF, M_NOWAIT); 135 M_DEVBUF, M_NOWAIT);
136 KASSERT(pbi != NULL); 136 KASSERT(pbi != NULL);
137 pbi->pbi_properties = prop_dictionary_create(); 137 pbi->pbi_properties = prop_dictionary_create();
138 KASSERT(pbi->pbi_properties != NULL); 138 KASSERT(pbi->pbi_properties != NULL);
139 139
140 SIMPLEQ_INIT(&genppc_pct->pc_pbi); 140 SIMPLEQ_INIT(&genppc_pct->pc_pbi);
141 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next); 141 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next);
142 142
143 /* find the primary host bridge */ 143 /* find the primary host bridge */
144 setup_pciintr_map(pbi, 0, 0, 0); 144 setup_pciintr_map(pbi, 0, 0, 0);
145 145
146#ifdef PCI_NETBSD_CONFIGURE 146#ifdef PCI_NETBSD_CONFIGURE
147 ioext = extent_create("pciio", 0x00008000, 0x0000ffff, M_DEVBUF, 147 ioext = extent_create("pciio", 0x00008000, 0x0000ffff,
148 NULL, 0, EX_NOWAIT); 148 NULL, 0, EX_NOWAIT);
149 memext = extent_create("pcimem", 0x00000000, 0x0fffffff, M_DEVBUF, 149 memext = extent_create("pcimem", 0x00000000, 0x0fffffff,
150 NULL, 0, EX_NOWAIT); 150 NULL, 0, EX_NOWAIT);
151 151
152 pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE); 152 pci_configure_bus(genppc_pct, ioext, memext, NULL, 0, CACHELINESIZE);
153 153
154 extent_destroy(ioext); 154 extent_destroy(ioext);
155 extent_destroy(memext); 155 extent_destroy(memext);
156#endif /* PCI_NETBSD_CONFIGURE */ 156#endif /* PCI_NETBSD_CONFIGURE */
157#endif /* NPCI */ 157#endif /* NPCI */
158 158
159/* scan pnpbus first */ 159/* scan pnpbus first */
160#if NPNPBUS > 0 160#if NPNPBUS > 0
161 mba.mba_paa.paa_name = "pnpbus"; 161 mba.mba_paa.paa_name = "pnpbus";
162 mba.mba_paa.paa_iot = &genppc_isa_io_space_tag; 162 mba.mba_paa.paa_iot = &genppc_isa_io_space_tag;

cvs diff -r1.27 -r1.28 src/sys/arch/sandpoint/sandpoint/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/sandpoint/sandpoint/mainbus.c 2012/01/14 19:39:25 1.27
+++ src/sys/arch/sandpoint/sandpoint/mainbus.c 2012/01/27 18:53:00 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.27 2012/01/14 19:39:25 phx Exp $ */ 1/* $NetBSD: mainbus.c,v 1.28 2012/01/27 18:53:00 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.27 2012/01/14 19:39:25 phx Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.28 2012/01/27 18:53:00 para Exp $");
35 35
36#include "opt_pci.h" 36#include "opt_pci.h"
37#include "pci.h" 37#include "pci.h"
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/extent.h> 40#include <sys/extent.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44 44
45#include <machine/autoconf.h> 45#include <machine/autoconf.h>
46#include <machine/bootinfo.h> 46#include <machine/bootinfo.h>
47#include <machine/isa_machdep.h> 47#include <machine/isa_machdep.h>
@@ -102,29 +102,29 @@ mainbus_attach(device_t parent, device_t @@ -102,29 +102,29 @@ mainbus_attach(device_t parent, device_t
102 mba.ma_name = "cfi"; 102 mba.ma_name = "cfi";
103 mba.ma_bst = &sandpoint_flash_space_tag; 103 mba.ma_bst = &sandpoint_flash_space_tag;
104 mba.ma_addr = 0xffe00000; /* smallest flash is 2 MiB */ 104 mba.ma_addr = 0xffe00000; /* smallest flash is 2 MiB */
105 config_found_ia(self, "mainbus", &mba, mainbus_print); 105 config_found_ia(self, "mainbus", &mba, mainbus_print);
106 106
107 /* 107 /*
108 * XXX Note also that the presence of a PCI bus should 108 * XXX Note also that the presence of a PCI bus should
109 * XXX _always_ be checked, and if present the bus should be 109 * XXX _always_ be checked, and if present the bus should be
110 * XXX 'found'. However, because of the structure of the code, 110 * XXX 'found'. However, because of the structure of the code,
111 * XXX that's not currently possible. 111 * XXX that's not currently possible.
112 */ 112 */
113#if NPCI > 0 113#if NPCI > 0
114#if defined(PCI_NETBSD_CONFIGURE) 114#if defined(PCI_NETBSD_CONFIGURE)
115 ioext = extent_create("pciio", 0x00001000, 0x0000ffff, M_DEVBUF, 115 ioext = extent_create("pciio", 0x00001000, 0x0000ffff,
116 NULL, 0, EX_NOWAIT); 116 NULL, 0, EX_NOWAIT);
117 memext = extent_create("pcimem", 0x80000000, 0x8fffffff, M_DEVBUF, 117 memext = extent_create("pcimem", 0x80000000, 0x8fffffff,
118 NULL, 0, EX_NOWAIT); 118 NULL, 0, EX_NOWAIT);
119 119
120 pci_configure_bus(0, ioext, memext, NULL, 0, 32); 120 pci_configure_bus(0, ioext, memext, NULL, 0, 32);
121 121
122 extent_destroy(ioext); 122 extent_destroy(ioext);
123 extent_destroy(memext); 123 extent_destroy(memext);
124#endif 124#endif
125 125
126 pba.pba_iot = &sandpoint_io_space_tag; 126 pba.pba_iot = &sandpoint_io_space_tag;
127 pba.pba_memt = &sandpoint_mem_space_tag; 127 pba.pba_memt = &sandpoint_mem_space_tag;
128 pba.pba_dmat = &pci_bus_dma_tag; 128 pba.pba_dmat = &pci_bus_dma_tag;
129 pba.pba_dmat64 = NULL; 129 pba.pba_dmat64 = NULL;
130 pba.pba_bus = 0; 130 pba.pba_bus = 0;

cvs diff -r1.9 -r1.10 src/sys/arch/sgimips/gio/pci_gio.c (expand / switch to unified diff)

--- src/sys/arch/sgimips/gio/pci_gio.c 2011/07/01 18:53:46 1.9
+++ src/sys/arch/sgimips/gio/pci_gio.c 2012/01/27 18:53:01 1.10
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1/* $NetBSD: pci_gio.c,v 1.9 2011/07/01 18:53:46 dyoung Exp $ */ 1/* $NetBSD: pci_gio.c,v 1.10 2012/01/27 18:53:01 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Stephen M. Rumble 4 * Copyright (c) 2006 Stephen M. Rumble
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. The name of the author may not be used to endorse or promote products 12 * 2. The name of the author may not be used to endorse or promote products
13 * derived from this software without specific prior written permission. 13 * derived from this software without specific prior written permission.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#include <sys/cdefs.h> 27#include <sys/cdefs.h>
28__KERNEL_RCSID(0, "$NetBSD: pci_gio.c,v 1.9 2011/07/01 18:53:46 dyoung Exp $"); 28__KERNEL_RCSID(0, "$NetBSD: pci_gio.c,v 1.10 2012/01/27 18:53:01 para Exp $");
29 29
30/* 30/*
31 * Glue for PCI devices that are connected to the GIO bus by various little 31 * Glue for PCI devices that are connected to the GIO bus by various little
32 * GIO<->PCI ASICs. 32 * GIO<->PCI ASICs.
33 * 33 *
34 * We presently support the following boards: 34 * We presently support the following boards:
35 * o Phobos G100/G130/G160 (if_tlp, lxtphy) 35 * o Phobos G100/G130/G160 (if_tlp, lxtphy)
36 * o Set Engineering GFE (if_tl, nsphy) 36 * o Set Engineering GFE (if_tl, nsphy)
37 */ 37 */
38 38
39#include "opt_pci.h" 39#include "opt_pci.h"
40#include "pci.h" 40#include "pci.h"
41 41
@@ -204,27 +204,27 @@ giopci_attach(struct device *parent, str @@ -204,27 +204,27 @@ giopci_attach(struct device *parent, str
204 pc->pc_conf_hook = giopci_conf_hook; 204 pc->pc_conf_hook = giopci_conf_hook;
205 pc->pc_intr_map = giopci_intr_map; 205 pc->pc_intr_map = giopci_intr_map;
206 pc->pc_intr_string = giopci_intr_string; 206 pc->pc_intr_string = giopci_intr_string;
207 pc->intr_establish = giopci_intr_establish; 207 pc->intr_establish = giopci_intr_establish;
208 pc->intr_disestablish = giopci_intr_disestablish; 208 pc->intr_disestablish = giopci_intr_disestablish;
209 pc->iot = ga->ga_iot; 209 pc->iot = ga->ga_iot;
210 pc->ioh = ga->ga_ioh; 210 pc->ioh = ga->ga_ioh;
211 pc->cookie = sc; 211 pc->cookie = sc;
212 212
213 printf(": %s\n", gio_product_string(sc->sc_gprid)); 213 printf(": %s\n", gio_product_string(sc->sc_gprid));
214 214
215#ifdef PCI_NETBSD_CONFIGURE 215#ifdef PCI_NETBSD_CONFIGURE
216 pc->pc_memext = extent_create("giopcimem", m_start, m_end, 216 pc->pc_memext = extent_create("giopcimem", m_start, m_end,
217 M_DEVBUF, NULL, 0, EX_NOWAIT); 217 NULL, 0, EX_NOWAIT);
218 pci_configure_bus(pc, NULL, pc->pc_memext, NULL, 0, 218 pci_configure_bus(pc, NULL, pc->pc_memext, NULL, 0,
219 mips_cache_info.mci_dcache_align); 219 mips_cache_info.mci_dcache_align);
220#endif 220#endif
221 221
222 memset(&pba, 0, sizeof(pba)); 222 memset(&pba, 0, sizeof(pba));
223 pba.pba_memt = SGIMIPS_BUS_SPACE_MEM; 223 pba.pba_memt = SGIMIPS_BUS_SPACE_MEM;
224 pba.pba_dmat = ga->ga_dmat; 224 pba.pba_dmat = ga->ga_dmat;
225 pba.pba_pc = pc; 225 pba.pba_pc = pc;
226 pba.pba_flags = PCI_FLAGS_MEM_OKAY; 226 pba.pba_flags = PCI_FLAGS_MEM_OKAY;
227 /* NB: do not set PCI_FLAGS_{MRL,MRM,MWI}_OKAY -- true ?! */ 227 /* NB: do not set PCI_FLAGS_{MRL,MRM,MWI}_OKAY -- true ?! */
228 228
229 config_found_ia(self, "pcibus", &pba, pcibusprint); 229 config_found_ia(self, "pcibus", &pba, pcibusprint);
230} 230}

cvs diff -r1.13 -r1.14 src/sys/arch/sgimips/mace/pci_mace.c (expand / switch to unified diff)

--- src/sys/arch/sgimips/mace/pci_mace.c 2011/07/01 18:53:47 1.13
+++ src/sys/arch/sgimips/mace/pci_mace.c 2012/01/27 18:53:01 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_mace.c,v 1.13 2011/07/01 18:53:47 dyoung Exp $ */ 1/* $NetBSD: pci_mace.c,v 1.14 2012/01/27 18:53:01 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001,2003 Christopher Sekiya 4 * Copyright (c) 2001,2003 Christopher Sekiya
5 * Copyright (c) 2000 Soren S. Jorvang 5 * Copyright (c) 2000 Soren S. Jorvang
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: pci_mace.c,v 1.13 2011/07/01 18:53:47 dyoung Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: pci_mace.c,v 1.14 2012/01/27 18:53:01 para Exp $");
38 38
39#include "opt_pci.h" 39#include "opt_pci.h"
40#include "pci.h" 40#include "pci.h"
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/device.h> 43#include <sys/device.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45 45
46#include <machine/cpu.h> 46#include <machine/cpu.h>
47#include <machine/locore.h> 47#include <machine/locore.h>
48#include <machine/autoconf.h> 48#include <machine/autoconf.h>
49#include <machine/vmparam.h> 49#include <machine/vmparam.h>
50#include <sys/bus.h> 50#include <sys/bus.h>
@@ -136,29 +136,29 @@ macepci_attach(struct device *parent, st @@ -136,29 +136,29 @@ macepci_attach(struct device *parent, st
136 MACE_PCI_CONTROL_TAR_INT | 136 MACE_PCI_CONTROL_TAR_INT |
137 MACE_PCI_CONTROL_MAR_INT); 137 MACE_PCI_CONTROL_MAR_INT);
138 138
139 /* 139 /*
140 * Enable all MACE PCI interrupts. They will be masked by 140 * Enable all MACE PCI interrupts. They will be masked by
141 * the CRIME code. 141 * the CRIME code.
142 */ 142 */
143 control = bus_space_read_4(pc->iot, pc->ioh, MACEPCI_CONTROL); 143 control = bus_space_read_4(pc->iot, pc->ioh, MACEPCI_CONTROL);
144 control |= CONTROL_INT_MASK; 144 control |= CONTROL_INT_MASK;
145 bus_space_write_4(pc->iot, pc->ioh, MACEPCI_CONTROL, control); 145 bus_space_write_4(pc->iot, pc->ioh, MACEPCI_CONTROL, control);
146 146
147#if NPCI > 0 147#if NPCI > 0
148 pc->pc_ioext = extent_create("macepciio", 0x00001000, 0x01ffffff, 148 pc->pc_ioext = extent_create("macepciio", 0x00001000, 0x01ffffff,
149 M_DEVBUF, NULL, 0, EX_NOWAIT); 149 NULL, 0, EX_NOWAIT);
150 pc->pc_memext = extent_create("macepcimem", 0x80100000, 0x81ffffff, 150 pc->pc_memext = extent_create("macepcimem", 0x80100000, 0x81ffffff,
151 M_DEVBUF, NULL, 0, EX_NOWAIT); 151 NULL, 0, EX_NOWAIT);
152 pci_configure_bus(pc, pc->pc_ioext, pc->pc_memext, NULL, 0, 152 pci_configure_bus(pc, pc->pc_ioext, pc->pc_memext, NULL, 0,
153 mips_cache_info.mci_dcache_align); 153 mips_cache_info.mci_dcache_align);
154 memset(&pba, 0, sizeof pba); 154 memset(&pba, 0, sizeof pba);
155/*XXX*/ pba.pba_iot = SGIMIPS_BUS_SPACE_IO; 155/*XXX*/ pba.pba_iot = SGIMIPS_BUS_SPACE_IO;
156/*XXX*/ pba.pba_memt = SGIMIPS_BUS_SPACE_MEM; 156/*XXX*/ pba.pba_memt = SGIMIPS_BUS_SPACE_MEM;
157 pba.pba_dmat = &pci_bus_dma_tag; 157 pba.pba_dmat = &pci_bus_dma_tag;
158 pba.pba_dmat64 = NULL; 158 pba.pba_dmat64 = NULL;
159 pba.pba_bus = 0; 159 pba.pba_bus = 0;
160 pba.pba_bridgetag = NULL; 160 pba.pba_bridgetag = NULL;
161 pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY | 161 pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
162 PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY; 162 PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
163 pba.pba_pc = pc; 163 pba.pba_pc = pc;
164 164

cvs diff -r1.16 -r1.17 src/sys/arch/sh3/dev/shpcic.c (expand / switch to unified diff)

--- src/sys/arch/sh3/dev/shpcic.c 2012/01/21 19:44:30 1.16
+++ src/sys/arch/sh3/dev/shpcic.c 2012/01/27 18:53:01 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: shpcic.c,v 1.16 2012/01/21 19:44:30 nonaka Exp $ */ 1/* $NetBSD: shpcic.c,v 1.17 2012/01/27 18:53:01 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (C) 2005 NONAKA Kimihiro <nonaka@netbsd.org> 4 * Copyright (C) 2005 NONAKA Kimihiro <nonaka@netbsd.org>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: shpcic.c,v 1.16 2012/01/21 19:44:30 nonaka Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: shpcic.c,v 1.17 2012/01/27 18:53:01 para Exp $");
30 30
31#include "opt_pci.h" 31#include "opt_pci.h"
32 32
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
35#include <sys/kernel.h> 35#include <sys/kernel.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/extent.h> 37#include <sys/extent.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39 39
40#include <dev/pci/pcireg.h> 40#include <dev/pci/pcireg.h>
41#include <dev/pci/pcivar.h> 41#include <dev/pci/pcivar.h>
42#include <dev/pci/pciconf.h> 42#include <dev/pci/pciconf.h>
@@ -218,30 +218,30 @@ shpcic_attach(device_t parent, device_t  @@ -218,30 +218,30 @@ shpcic_attach(device_t parent, device_t
218 | PCI_STATUS_DEVSEL_MEDIUM); 218 | PCI_STATUS_DEVSEL_MEDIUM);
219 219
220 /* Initialize done. */ 220 /* Initialize done. */
221 _reg_write_4(SH4_PCICR, PCICR_BASE | PCICR_CFINIT); 221 _reg_write_4(SH4_PCICR, PCICR_BASE | PCICR_CFINIT);
222 222
223 /* set PCI controller interrupt priority */ 223 /* set PCI controller interrupt priority */
224 intpri_intr_priority(SH4_INTEVT_PCIERR, shpcic_intr_priority[0]); 224 intpri_intr_priority(SH4_INTEVT_PCIERR, shpcic_intr_priority[0]);
225 intpri_intr_priority(SH4_INTEVT_PCISERR, shpcic_intr_priority[1]); 225 intpri_intr_priority(SH4_INTEVT_PCISERR, shpcic_intr_priority[1]);
226 226
227 /* PCI bus */ 227 /* PCI bus */
228#ifdef PCI_NETBSD_CONFIGURE 228#ifdef PCI_NETBSD_CONFIGURE
229 ioext = extent_create("pciio", 229 ioext = extent_create("pciio",
230 SH4_PCIC_IO, SH4_PCIC_IO + SH4_PCIC_IO_SIZE - 1, 230 SH4_PCIC_IO, SH4_PCIC_IO + SH4_PCIC_IO_SIZE - 1,
231 M_DEVBUF, NULL, 0, EX_NOWAIT); 231 NULL, 0, EX_NOWAIT);
232 memext = extent_create("pcimem", 232 memext = extent_create("pcimem",
233 SH4_PCIC_MEM, SH4_PCIC_MEM + SH4_PCIC_MEM_SIZE - 1, 233 SH4_PCIC_MEM, SH4_PCIC_MEM + SH4_PCIC_MEM_SIZE - 1,
234 M_DEVBUF, NULL, 0, EX_NOWAIT); 234 NULL, 0, EX_NOWAIT);
235 235
236 pci_configure_bus(NULL, ioext, memext, NULL, 0, sh_cache_line_size); 236 pci_configure_bus(NULL, ioext, memext, NULL, 0, sh_cache_line_size);
237 237
238 extent_destroy(ioext); 238 extent_destroy(ioext);
239 extent_destroy(memext); 239 extent_destroy(memext);
240#endif 240#endif
241 241
242 /* PCI bus */ 242 /* PCI bus */
243 memset(&pba, 0, sizeof(pba)); 243 memset(&pba, 0, sizeof(pba));
244 pba.pba_iot = shpcic_get_bus_io_tag(); 244 pba.pba_iot = shpcic_get_bus_io_tag();
245 pba.pba_memt = shpcic_get_bus_mem_tag(); 245 pba.pba_memt = shpcic_get_bus_mem_tag();
246 pba.pba_dmat = shpcic_get_bus_dma_tag(); 246 pba.pba_dmat = shpcic_get_bus_dma_tag();
247 pba.pba_dmat64 = NULL; 247 pba.pba_dmat64 = NULL;

cvs diff -r1.65 -r1.66 src/sys/arch/sparc/dev/vme_machdep.c (expand / switch to unified diff)

--- src/sys/arch/sparc/dev/vme_machdep.c 2011/07/18 00:31:13 1.65
+++ src/sys/arch/sparc/dev/vme_machdep.c 2012/01/27 18:53:01 1.66
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vme_machdep.c,v 1.65 2011/07/18 00:31:13 mrg Exp $ */ 1/* $NetBSD: vme_machdep.c,v 1.66 2012/01/27 18:53:01 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Paul Kranenburg. 8 * by Paul Kranenburg.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.65 2011/07/18 00:31:13 mrg Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.66 2012/01/27 18:53:01 para Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/extent.h> 36#include <sys/extent.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40#include <sys/errno.h> 40#include <sys/errno.h>
41 41
42#include <sys/proc.h> 42#include <sys/proc.h>
43#include <sys/syslog.h> 43#include <sys/syslog.h>
44 44
45#include <uvm/uvm_extern.h> 45#include <uvm/uvm_extern.h>
46 46
@@ -305,27 +305,27 @@ vmeattach_mainbus(device_t parent, devic @@ -305,27 +305,27 @@ vmeattach_mainbus(device_t parent, devic
305/*XXX*/ sparc_vme_chipset_tag.vct_dmamap_destroy = sparc_vct_dmamap_destroy; 305/*XXX*/ sparc_vme_chipset_tag.vct_dmamap_destroy = sparc_vct_dmamap_destroy;
306/*XXX*/ sparc_vme4_dma_tag._cookie = sc; 306/*XXX*/ sparc_vme4_dma_tag._cookie = sc;
307 307
308 vba.va_vct = &sparc_vme_chipset_tag; 308 vba.va_vct = &sparc_vme_chipset_tag;
309 vba.va_bdt = &sparc_vme4_dma_tag; 309 vba.va_bdt = &sparc_vme4_dma_tag;
310 vba.va_slaveconfig = 0; 310 vba.va_slaveconfig = 0;
311 311
312 /* Fall back to our own `range' construction */ 312 /* Fall back to our own `range' construction */
313 sc->sc_range = vmebus_translations; 313 sc->sc_range = vmebus_translations;
314 sc->sc_nrange = 314 sc->sc_nrange =
315 sizeof(vmebus_translations)/sizeof(vmebus_translations[0]); 315 sizeof(vmebus_translations)/sizeof(vmebus_translations[0]);
316 316
317 vme_dvmamap = extent_create("vmedvma", VME4_DVMA_BASE, VME4_DVMA_END, 317 vme_dvmamap = extent_create("vmedvma", VME4_DVMA_BASE, VME4_DVMA_END,
318 M_DEVBUF, 0, 0, EX_NOWAIT); 318 0, 0, EX_NOWAIT);
319 if (vme_dvmamap == NULL) 319 if (vme_dvmamap == NULL)
320 panic("vme: unable to allocate DVMA map"); 320 panic("vme: unable to allocate DVMA map");
321 321
322 printf("\n"); 322 printf("\n");
323 (void)config_found(self, &vba, 0); 323 (void)config_found(self, &vba, 0);
324 324
325#endif /* SUN4 */ 325#endif /* SUN4 */
326 return; 326 return;
327} 327}
328 328
329/* sun4m vmebus */ 329/* sun4m vmebus */
330static void 330static void
331vmeattach_iommu(struct device *parent, struct device *self, void *aux) 331vmeattach_iommu(struct device *parent, struct device *self, void *aux)

cvs diff -r1.94 -r1.95 src/sys/arch/sparc/sparc/iommu.c (expand / switch to unified diff)

--- src/sys/arch/sparc/sparc/iommu.c 2011/07/17 23:18:23 1.94
+++ src/sys/arch/sparc/sparc/iommu.c 2012/01/27 18:53:02 1.95
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: iommu.c,v 1.94 2011/07/17 23:18:23 mrg Exp $ */ 1/* $NetBSD: iommu.c,v 1.95 2012/01/27 18:53:02 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 4 * Copyright (c) 1996
5 * The President and Fellows of Harvard College. All rights reserved. 5 * The President and Fellows of Harvard College. All rights reserved.
6 * Copyright (c) 1995 Paul Kranenburg 6 * Copyright (c) 1995 Paul Kranenburg
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE. 35 * SUCH DAMAGE.
36 * 36 *
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.94 2011/07/17 23:18:23 mrg Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.95 2012/01/27 18:53:02 para Exp $");
41 41
42#include "opt_sparc_arch.h" 42#include "opt_sparc_arch.h"
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/extent.h> 45#include <sys/extent.h>
46#include <sys/malloc.h> 46#include <sys/malloc.h>
47#include <sys/queue.h> 47#include <sys/queue.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/device.h> 49#include <sys/device.h>
50#include <sys/proc.h> 50#include <sys/proc.h>
51 51
52#include <uvm/uvm.h> 52#include <uvm/uvm.h>
53 53
@@ -266,27 +266,27 @@ iommu_attach(device_t parent, device_t s @@ -266,27 +266,27 @@ iommu_attach(device_t parent, device_t s
266 sc->sc_reg->io_bar = (iopte_table_pa >> 4) & IOMMU_BAR_IBA; 266 sc->sc_reg->io_bar = (iopte_table_pa >> 4) & IOMMU_BAR_IBA;
267 267
268 IOMMU_FLUSHALL(sc); 268 IOMMU_FLUSHALL(sc);
269 splx(s); 269 splx(s);
270 270
271 printf(": version 0x%x/0x%x, page-size %d, range %dMB\n", 271 printf(": version 0x%x/0x%x, page-size %d, range %dMB\n",
272 (sc->sc_reg->io_cr & IOMMU_CTL_VER) >> 24, 272 (sc->sc_reg->io_cr & IOMMU_CTL_VER) >> 24,
273 (sc->sc_reg->io_cr & IOMMU_CTL_IMPL) >> 28, 273 (sc->sc_reg->io_cr & IOMMU_CTL_IMPL) >> 28,
274 sc->sc_pagesize, 274 sc->sc_pagesize,
275 sc->sc_range >> 20); 275 sc->sc_range >> 20);
276 276
277 sc->sc_dvmamap = extent_create("iommudvma", 277 sc->sc_dvmamap = extent_create("iommudvma",
278 IOMMU_DVMA_BASE, IOMMU_DVMA_END, 278 IOMMU_DVMA_BASE, IOMMU_DVMA_END,
279 M_DEVBUF, 0, 0, EX_NOWAIT); 279 0, 0, EX_NOWAIT);
280 if (sc->sc_dvmamap == NULL) 280 if (sc->sc_dvmamap == NULL)
281 panic("iommu: unable to allocate DVMA map"); 281 panic("iommu: unable to allocate DVMA map");
282 282
283 /* 283 /*
284 * If we are attaching implicit iommu on JS1/OF we do not have 284 * If we are attaching implicit iommu on JS1/OF we do not have
285 * an iommu node to traverse, instead mainbus_attach passed us 285 * an iommu node to traverse, instead mainbus_attach passed us
286 * sbus node in ma.ma_node. Attach it as the only iommu child. 286 * sbus node in ma.ma_node. Attach it as the only iommu child.
287 */ 287 */
288 if (js1_implicit_iommu) { 288 if (js1_implicit_iommu) {
289 struct iommu_attach_args ia; 289 struct iommu_attach_args ia;
290 struct openprom_addr sbus_iommu_reg = { 0, 0x10001000, 0x28 }; 290 struct openprom_addr sbus_iommu_reg = { 0, 0x10001000, 0x28 };
291 291
292 memset(&ia, 0, sizeof ia); 292 memset(&ia, 0, sizeof ia);

cvs diff -r1.314 -r1.315 src/sys/arch/sparc/sparc/machdep.c (expand / switch to unified diff)

--- src/sys/arch/sparc/sparc/machdep.c 2011/12/12 19:03:11 1.314
+++ src/sys/arch/sparc/sparc/machdep.c 2012/01/27 18:53:02 1.315
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.314 2011/12/12 19:03:11 mrg Exp $ */ 1/* $NetBSD: machdep.c,v 1.315 2012/01/27 18:53:02 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -61,27 +61,27 @@ @@ -61,27 +61,27 @@
61 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 61 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
62 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 62 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE. 68 * SUCH DAMAGE.
69 * 69 *
70 * @(#)machdep.c 8.6 (Berkeley) 1/14/94 70 * @(#)machdep.c 8.6 (Berkeley) 1/14/94
71 */ 71 */
72 72
73#include <sys/cdefs.h> 73#include <sys/cdefs.h>
74__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.314 2011/12/12 19:03:11 mrg Exp $"); 74__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.315 2012/01/27 18:53:02 para Exp $");
75 75
76#include "opt_compat_netbsd.h" 76#include "opt_compat_netbsd.h"
77#include "opt_compat_sunos.h" 77#include "opt_compat_sunos.h"
78#include "opt_sparc_arch.h" 78#include "opt_sparc_arch.h"
79#include "opt_modular.h" 79#include "opt_modular.h"
80#include "opt_multiprocessor.h" 80#include "opt_multiprocessor.h"
81 81
82#include <sys/param.h> 82#include <sys/param.h>
83#include <sys/signal.h> 83#include <sys/signal.h>
84#include <sys/signalvar.h> 84#include <sys/signalvar.h>
85#include <sys/proc.h> 85#include <sys/proc.h>
86#include <sys/extent.h> 86#include <sys/extent.h>
87#include <sys/savar.h> 87#include <sys/savar.h>
@@ -313,27 +313,27 @@ cpu_startup(void) @@ -313,27 +313,27 @@ cpu_startup(void)
313#endif 313#endif
314#if MAXSSIZ > 256*1024*1024 314#if MAXSSIZ > 256*1024*1024
315 maxsmap = 256*1024*1024; 315 maxsmap = 256*1024*1024;
316#endif 316#endif
317 } 317 }
318 318
319 if (CPU_ISSUN4 || CPU_ISSUN4C) { 319 if (CPU_ISSUN4 || CPU_ISSUN4C) {
320 /* 320 /*
321 * Allocate DMA map for 24-bit devices (le, ie) 321 * Allocate DMA map for 24-bit devices (le, ie)
322 * [dvma_base - dvma_end] is for VME devices.. 322 * [dvma_base - dvma_end] is for VME devices..
323 */ 323 */
324 dvmamap24 = extent_create("dvmamap24", 324 dvmamap24 = extent_create("dvmamap24",
325 D24_DVMA_BASE, D24_DVMA_END, 325 D24_DVMA_BASE, D24_DVMA_END,
326 M_DEVBUF, 0, 0, EX_NOWAIT); 326 0, 0, EX_NOWAIT);
327 if (dvmamap24 == NULL) 327 if (dvmamap24 == NULL)
328 panic("unable to allocate DVMA map"); 328 panic("unable to allocate DVMA map");
329 } 329 }
330 330
331#ifdef DEBUG 331#ifdef DEBUG
332 pmapdebug = opmapdebug; 332 pmapdebug = opmapdebug;
333#endif 333#endif
334 format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); 334 format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
335 printf("avail memory = %s\n", pbuf); 335 printf("avail memory = %s\n", pbuf);
336 336
337 pmap_redzone(); 337 pmap_redzone();
338 338
339 mutex_init(&fpu_mtx, MUTEX_DEFAULT, IPL_SCHED); 339 mutex_init(&fpu_mtx, MUTEX_DEFAULT, IPL_SCHED);

cvs diff -r1.105 -r1.106 src/sys/arch/sparc64/dev/iommu.c (expand / switch to unified diff)

--- src/sys/arch/sparc64/dev/iommu.c 2011/10/08 08:49:07 1.105
+++ src/sys/arch/sparc64/dev/iommu.c 2012/01/27 18:53:03 1.106
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: iommu.c,v 1.105 2011/10/08 08:49:07 nakayama Exp $ */ 1/* $NetBSD: iommu.c,v 1.106 2012/01/27 18:53:03 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999, 2000 Matthew R. Green 4 * Copyright (c) 1999, 2000 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -49,27 +49,27 @@ @@ -49,27 +49,27 @@
49 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 49 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 50 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
51 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 51 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
52 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 52 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE. 54 * SUCH DAMAGE.
55 */ 55 */
56 56
57/* 57/*
58 * UltraSPARC IOMMU support; used by both the sbus and pci code. 58 * UltraSPARC IOMMU support; used by both the sbus and pci code.
59 */ 59 */
60 60
61#include <sys/cdefs.h> 61#include <sys/cdefs.h>
62__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.105 2011/10/08 08:49:07 nakayama Exp $"); 62__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.106 2012/01/27 18:53:03 para Exp $");
63 63
64#include "opt_ddb.h" 64#include "opt_ddb.h"
65 65
66#include <sys/param.h> 66#include <sys/param.h>
67#include <sys/extent.h> 67#include <sys/extent.h>
68#include <sys/malloc.h> 68#include <sys/malloc.h>
69#include <sys/systm.h> 69#include <sys/systm.h>
70#include <sys/device.h> 70#include <sys/device.h>
71#include <sys/proc.h> 71#include <sys/proc.h>
72 72
73#include <uvm/uvm.h> 73#include <uvm/uvm.h>
74 74
75#include <sys/bus.h> 75#include <sys/bus.h>
@@ -190,27 +190,27 @@ iommu_init(char *name, struct iommu_stat @@ -190,27 +190,27 @@ iommu_init(char *name, struct iommu_stat
190#endif 190#endif
191 191
192 /* 192 /*
193 * Now all the hardware's working we need to allocate a dvma map. 193 * Now all the hardware's working we need to allocate a dvma map.
194 */ 194 */
195 aprint_debug("DVMA map: %x to %x\n", 195 aprint_debug("DVMA map: %x to %x\n",
196 (unsigned int)is->is_dvmabase, 196 (unsigned int)is->is_dvmabase,
197 (unsigned int)is->is_dvmaend); 197 (unsigned int)is->is_dvmaend);
198 aprint_debug("IOTSB: %llx to %llx\n", 198 aprint_debug("IOTSB: %llx to %llx\n",
199 (unsigned long long)is->is_ptsb, 199 (unsigned long long)is->is_ptsb,
200 (unsigned long long)(is->is_ptsb + size - 1)); 200 (unsigned long long)(is->is_ptsb + size - 1));
201 is->is_dvmamap = extent_create(name, 201 is->is_dvmamap = extent_create(name,
202 is->is_dvmabase, is->is_dvmaend, 202 is->is_dvmabase, is->is_dvmaend,
203 M_DEVBUF, 0, 0, EX_NOWAIT); 203 0, 0, EX_NOWAIT);
204 /* XXXMRG Check is_dvmamap is valid. */ 204 /* XXXMRG Check is_dvmamap is valid. */
205 205
206 /* 206 /*
207 * Set the TSB size. The relevant bits were moved to the TSB 207 * Set the TSB size. The relevant bits were moved to the TSB
208 * base register in the PCIe host bridges. 208 * base register in the PCIe host bridges.
209 */ 209 */
210 if (is->is_flags & IOMMU_TSBSIZE_IN_PTSB) 210 if (is->is_flags & IOMMU_TSBSIZE_IN_PTSB)
211 is->is_ptsb |= is->is_tsbsize; 211 is->is_ptsb |= is->is_tsbsize;
212 else 212 else
213 is->is_cr |= (is->is_tsbsize << 16); 213 is->is_cr |= (is->is_tsbsize << 16);
214 214
215 /* 215 /*
216 * now actually start up the IOMMU 216 * now actually start up the IOMMU

cvs diff -r1.111 -r1.112 src/sys/arch/sparc64/dev/psycho.c (expand / switch to unified diff)

--- src/sys/arch/sparc64/dev/psycho.c 2011/09/04 12:17:14 1.111
+++ src/sys/arch/sparc64/dev/psycho.c 2012/01/27 18:53:03 1.112
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: psycho.c,v 1.111 2011/09/04 12:17:14 nakayama Exp $ */ 1/* $NetBSD: psycho.c,v 1.112 2012/01/27 18:53:03 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999, 2000 Matthew R. Green 4 * Copyright (c) 1999, 2000 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -45,27 +45,27 @@ @@ -45,27 +45,27 @@
45 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 45 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
46 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 46 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
47 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 47 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
48 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 48 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
49 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 49 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 50 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
51 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 51 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
52 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 52 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE. 54 * SUCH DAMAGE.
55 */ 55 */
56 56
57#include <sys/cdefs.h> 57#include <sys/cdefs.h>
58__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.111 2011/09/04 12:17:14 nakayama Exp $"); 58__KERNEL_RCSID(0, "$NetBSD: psycho.c,v 1.112 2012/01/27 18:53:03 para Exp $");
59 59
60#include "opt_ddb.h" 60#include "opt_ddb.h"
61 61
62/* 62/*
63 * Support for `psycho' and `psycho+' UPA to PCI bridge and 63 * Support for `psycho' and `psycho+' UPA to PCI bridge and
64 * UltraSPARC IIi and IIe `sabre' PCI controllers. 64 * UltraSPARC IIi and IIe `sabre' PCI controllers.
65 */ 65 */
66 66
67#ifdef DEBUG 67#ifdef DEBUG
68#define PDB_PROM 0x01 68#define PDB_PROM 0x01
69#define PDB_BUSMAP 0x02 69#define PDB_BUSMAP 0x02
70#define PDB_INTR 0x04 70#define PDB_INTR 0x04
71#define PDB_INTMAP 0x08 71#define PDB_INTMAP 0x08
@@ -786,28 +786,27 @@ psycho_alloc_extent(struct psycho_pbm *p @@ -786,28 +786,27 @@ psycho_alloc_extent(struct psycho_pbm *p
786 return NULL; 786 return NULL;
787 } 787 }
788 baddr = 0x00000000; 788 baddr = 0x00000000;
789 bsize = BUS_ADDR(pr->size_hi, pr->size_lo); 789 bsize = BUS_ADDR(pr->size_hi, pr->size_lo);
790 790
791 /* get available lists */ 791 /* get available lists */
792 num = 0; 792 num = 0;
793 if (prom_getprop(node, "available", sizeof(*pa), &num, &pa)) { 793 if (prom_getprop(node, "available", sizeof(*pa), &num, &pa)) {
794 printf("psycho_alloc_extent: no \"available\" property\n"); 794 printf("psycho_alloc_extent: no \"available\" property\n");
795 return NULL; 795 return NULL;
796 } 796 }
797 797
798 /* create extent */ 798 /* create extent */
799 ex = extent_create(name, baddr, bsize - baddr - 1, M_DEVBUF, 0, 0, 799 ex = extent_create(name, baddr, bsize - baddr - 1, 0, 0, EX_NOWAIT);
800 EX_NOWAIT); 
801 if (ex == NULL) { 800 if (ex == NULL) {
802 printf("psycho_alloc_extent: extent_create failed\n"); 801 printf("psycho_alloc_extent: extent_create failed\n");
803 goto ret; 802 goto ret;
804 } 803 }
805 804
806 /* allocate assigned regions */ 805 /* allocate assigned regions */
807 for (i = 0; i < num; i++) 806 for (i = 0; i < num; i++)
808 if (((pa[i].phys_hi >> 24) & 0x03) == ss) { 807 if (((pa[i].phys_hi >> 24) & 0x03) == ss) {
809 /* allocate bus space */ 808 /* allocate bus space */
810 addr = BUS_ADDR(pa[i].phys_mid, pa[i].phys_lo); 809 addr = BUS_ADDR(pa[i].phys_mid, pa[i].phys_lo);
811 size = BUS_ADDR(pa[i].size_hi, pa[i].size_lo); 810 size = BUS_ADDR(pa[i].size_hi, pa[i].size_lo);
812 if (extent_alloc_region(ex, baddr, addr - baddr, 811 if (extent_alloc_region(ex, baddr, addr - baddr,
813 EX_NOWAIT)) { 812 EX_NOWAIT)) {

cvs diff -r1.263 -r1.264 src/sys/arch/sparc64/sparc64/machdep.c (expand / switch to unified diff)

--- src/sys/arch/sparc64/sparc64/machdep.c 2011/12/12 19:03:11 1.263
+++ src/sys/arch/sparc64/sparc64/machdep.c 2012/01/27 18:53:03 1.264
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.263 2011/12/12 19:03:11 mrg Exp $ */ 1/* $NetBSD: machdep.c,v 1.264 2012/01/27 18:53:03 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -61,27 +61,27 @@ @@ -61,27 +61,27 @@
61 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 61 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
62 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 62 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE. 68 * SUCH DAMAGE.
69 * 69 *
70 * @(#)machdep.c 8.6 (Berkeley) 1/14/94 70 * @(#)machdep.c 8.6 (Berkeley) 1/14/94
71 */ 71 */
72 72
73#include <sys/cdefs.h> 73#include <sys/cdefs.h>
74__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.263 2011/12/12 19:03:11 mrg Exp $"); 74__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.264 2012/01/27 18:53:03 para Exp $");
75 75
76#include "opt_ddb.h" 76#include "opt_ddb.h"
77#include "opt_multiprocessor.h" 77#include "opt_multiprocessor.h"
78#include "opt_compat_netbsd.h" 78#include "opt_compat_netbsd.h"
79#include "opt_compat_svr4.h" 79#include "opt_compat_svr4.h"
80#include "opt_compat_sunos.h" 80#include "opt_compat_sunos.h"
81 81
82#include <sys/param.h> 82#include <sys/param.h>
83#include <sys/extent.h> 83#include <sys/extent.h>
84#include <sys/signal.h> 84#include <sys/signal.h>
85#include <sys/signalvar.h> 85#include <sys/signalvar.h>
86#include <sys/proc.h> 86#include <sys/proc.h>
87#include <sys/sa.h> 87#include <sys/sa.h>
@@ -2294,27 +2294,27 @@ sparc_bus_map(bus_space_tag_t t, bus_add @@ -2294,27 +2294,27 @@ sparc_bus_map(bus_space_tag_t t, bus_add
2294{ 2294{
2295 vaddr_t v; 2295 vaddr_t v;
2296 uint64_t pa; 2296 uint64_t pa;
2297 paddr_t pm_flags = 0; 2297 paddr_t pm_flags = 0;
2298 vm_prot_t pm_prot = VM_PROT_READ; 2298 vm_prot_t pm_prot = VM_PROT_READ;
2299 int err, map_little = 0; 2299 int err, map_little = 0;
2300 2300
2301 if (io_space == NULL) 2301 if (io_space == NULL)
2302 /* 2302 /*
2303 * And set up IOSPACE extents. 2303 * And set up IOSPACE extents.
2304 */ 2304 */
2305 io_space = extent_create("IOSPACE", 2305 io_space = extent_create("IOSPACE",
2306 (u_long)IODEV_BASE, (u_long)IODEV_END, 2306 (u_long)IODEV_BASE, (u_long)IODEV_END,
2307 M_DEVBUF, 0, 0, EX_NOWAIT); 2307 0, 0, EX_NOWAIT);
2308 2308
2309 2309
2310 size = round_page(size); 2310 size = round_page(size);
2311 if (size == 0) { 2311 if (size == 0) {
2312 printf("sparc_bus_map: zero size\n"); 2312 printf("sparc_bus_map: zero size\n");
2313 return (EINVAL); 2313 return (EINVAL);
2314 } 2314 }
2315 switch (t->type) { 2315 switch (t->type) {
2316 case PCI_CONFIG_BUS_SPACE: 2316 case PCI_CONFIG_BUS_SPACE:
2317 /*  2317 /*
2318 * PCI config space is special. 2318 * PCI config space is special.
2319 * 2319 *
2320 * It's really big and seldom used. In order not to run 2320 * It's really big and seldom used. In order not to run

cvs diff -r1.71 -r1.72 src/sys/arch/sun2/sun2/machdep.c (expand / switch to unified diff)

--- src/sys/arch/sun2/sun2/machdep.c 2011/12/12 19:03:11 1.71
+++ src/sys/arch/sun2/sun2/machdep.c 2012/01/27 18:53:03 1.72
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.71 2011/12/12 19:03:11 mrg Exp $ */ 1/* $NetBSD: machdep.c,v 1.72 2012/01/27 18:53:03 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1986, 1990, 1993 4 * Copyright (c) 1982, 1986, 1990, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -139,27 +139,27 @@ @@ -139,27 +139,27 @@
139 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 139 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
140 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 140 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
141 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 141 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
142 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 142 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
143 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 143 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
144 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 144 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
145 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 145 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
146 * SUCH DAMAGE. 146 * SUCH DAMAGE.
147 * 147 *
148 * @(#)machdep.c 8.6 (Berkeley) 1/14/94 148 * @(#)machdep.c 8.6 (Berkeley) 1/14/94
149 */ 149 */
150 150
151#include <sys/cdefs.h> 151#include <sys/cdefs.h>
152__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.71 2011/12/12 19:03:11 mrg Exp $"); 152__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.72 2012/01/27 18:53:03 para Exp $");
153 153
154#include "opt_ddb.h" 154#include "opt_ddb.h"
155#include "opt_kgdb.h" 155#include "opt_kgdb.h"
156#include "opt_fpu_emulate.h" 156#include "opt_fpu_emulate.h"
157#include "opt_modular.h" 157#include "opt_modular.h"
158 158
159#include <sys/param.h> 159#include <sys/param.h>
160#include <sys/systm.h> 160#include <sys/systm.h>
161#include <sys/kernel.h> 161#include <sys/kernel.h>
162#include <sys/proc.h> 162#include <sys/proc.h>
163#include <sys/buf.h> 163#include <sys/buf.h>
164#include <sys/reboot.h> 164#include <sys/reboot.h>
165#include <sys/conf.h> 165#include <sys/conf.h>
@@ -348,27 +348,27 @@ cpu_startup(void) @@ -348,27 +348,27 @@ cpu_startup(void)
348 /* 348 /*
349 * Allocate a virtual page (for use by /dev/mem) 349 * Allocate a virtual page (for use by /dev/mem)
350 * This page is handed to pmap_enter() therefore 350 * This page is handed to pmap_enter() therefore
351 * it has to be in the normal kernel VA range. 351 * it has to be in the normal kernel VA range.
352 */ 352 */
353 vmmap = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, 353 vmmap = uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
354 UVM_KMF_VAONLY | UVM_KMF_WAITVA); 354 UVM_KMF_VAONLY | UVM_KMF_WAITVA);
355 355
356 /* 356 /*
357 * Allocate DMA map for devices on the bus. 357 * Allocate DMA map for devices on the bus.
358 */ 358 */
359 dvmamap = extent_create("dvmamap", 359 dvmamap = extent_create("dvmamap",
360 DVMA_MAP_BASE, DVMA_MAP_BASE + DVMA_MAP_AVAIL, 360 DVMA_MAP_BASE, DVMA_MAP_BASE + DVMA_MAP_AVAIL,
361 M_DEVBUF, 0, 0, EX_NOWAIT); 361 0, 0, EX_NOWAIT);
362 if (dvmamap == NULL) 362 if (dvmamap == NULL)
363 panic("unable to allocate DVMA map"); 363 panic("unable to allocate DVMA map");
364 364
365 /* 365 /*
366 * Set up CPU-specific registers, cache, etc. 366 * Set up CPU-specific registers, cache, etc.
367 */ 367 */
368 initcpu(); 368 initcpu();
369} 369}
370 370
371/* 371/*
372 * Info for CTL_HW 372 * Info for CTL_HW
373 */ 373 */
374char machine[16] = MACHINE; /* from <machine/param.h> */ 374char machine[16] = MACHINE; /* from <machine/param.h> */

cvs diff -r1.36 -r1.37 src/sys/arch/sun3/sun3/dvma.c (expand / switch to unified diff)

--- src/sys/arch/sun3/sun3/dvma.c 2009/12/11 13:52:57 1.36
+++ src/sys/arch/sun3/sun3/dvma.c 2012/01/27 18:53:03 1.37
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dvma.c,v 1.36 2009/12/11 13:52:57 tsutsui Exp $ */ 1/* $NetBSD: dvma.c,v 1.37 2012/01/27 18:53:03 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Gordon W. Ross. 8 * by Gordon W. Ross.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: dvma.c,v 1.36 2009/12/11 13:52:57 tsutsui Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: dvma.c,v 1.37 2012/01/27 18:53:03 para Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/proc.h> 38#include <sys/proc.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40#include <sys/extent.h> 40#include <sys/extent.h>
41#include <sys/buf.h> 41#include <sys/buf.h>
42#include <sys/vnode.h> 42#include <sys/vnode.h>
43#include <sys/core.h> 43#include <sys/core.h>
44#include <sys/exec.h> 44#include <sys/exec.h>
45 45
46#include <uvm/uvm.h> /* XXX: not _extern ... need uvm_map_create */ 46#include <uvm/uvm.h> /* XXX: not _extern ... need uvm_map_create */
@@ -92,27 +92,27 @@ dvma_init(void) @@ -92,27 +92,27 @@ dvma_init(void)
92 * The remainder of phys_map is used for DVMA scratch 92 * The remainder of phys_map is used for DVMA scratch
93 * memory pages (i.e. driver control blocks, etc.) 93 * memory pages (i.e. driver control blocks, etc.)
94 */ 94 */
95 segmap_addr = uvm_km_alloc(phys_map, dvma_segmap_size, 0, 95 segmap_addr = uvm_km_alloc(phys_map, dvma_segmap_size, 0,
96 UVM_KMF_VAONLY | UVM_KMF_WAITVA); 96 UVM_KMF_VAONLY | UVM_KMF_WAITVA);
97 if (segmap_addr != DVMA_MAP_BASE) 97 if (segmap_addr != DVMA_MAP_BASE)
98 panic("dvma_init: unable to allocate DVMA segments"); 98 panic("dvma_init: unable to allocate DVMA segments");
99 99
100 /* 100 /*
101 * Create the VM pool used for mapping whole segments 101 * Create the VM pool used for mapping whole segments
102 * into DVMA space for the purpose of data transfer. 102 * into DVMA space for the purpose of data transfer.
103 */ 103 */
104 dvma_extent = extent_create("dvma", segmap_addr, 104 dvma_extent = extent_create("dvma", segmap_addr,
105 segmap_addr + (dvma_segmap_size - 1), M_DEVBUF, 105 segmap_addr + (dvma_segmap_size - 1),
106 NULL, 0, EX_NOCOALESCE|EX_NOWAIT); 106 NULL, 0, EX_NOCOALESCE|EX_NOWAIT);
107} 107}
108 108
109/* 109/*
110 * Allocate actual memory pages in DVMA space. 110 * Allocate actual memory pages in DVMA space.
111 * (idea for implementation borrowed from Chris Torek.) 111 * (idea for implementation borrowed from Chris Torek.)
112 */ 112 */
113void * 113void *
114dvma_malloc(size_t bytes) 114dvma_malloc(size_t bytes)
115{ 115{
116 void *new_mem; 116 void *new_mem;
117 vsize_t new_size; 117 vsize_t new_size;
118 118

cvs diff -r1.40 -r1.41 src/sys/arch/sun3/sun3x/dvma.c (expand / switch to unified diff)

--- src/sys/arch/sun3/sun3x/dvma.c 2009/11/21 04:16:53 1.40
+++ src/sys/arch/sun3/sun3x/dvma.c 2012/01/27 18:53:04 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: dvma.c,v 1.40 2009/11/21 04:16:53 rmind Exp $ */ 1/* $NetBSD: dvma.c,v 1.41 2012/01/27 18:53:04 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Gordon W. Ross and Jeremy Cooper. 8 * by Gordon W. Ross and Jeremy Cooper.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -59,27 +59,27 @@ @@ -59,27 +59,27 @@
59 * a specially reserved section of the CPU's virtual address space, 16 59 * a specially reserved section of the CPU's virtual address space, 16
60 * Megabytes in size. Whenever a DVMA buffer is allocated, the allocation 60 * Megabytes in size. Whenever a DVMA buffer is allocated, the allocation
61 * code will enter in a mapping both in the MC68030 MMU page tables and the 61 * code will enter in a mapping both in the MC68030 MMU page tables and the
62 * I/O mapper. 62 * I/O mapper.
63 * 63 *
64 * The address returned by the allocation routine is a virtual address that 64 * The address returned by the allocation routine is a virtual address that
65 * the requesting driver must use to access the buffer. It is up to the 65 * the requesting driver must use to access the buffer. It is up to the
66 * device driver to convert this virtual address into the appropriate slave 66 * device driver to convert this virtual address into the appropriate slave
67 * address that its device should issue to access the buffer. (There will be 67 * address that its device should issue to access the buffer. (There will be
68 * routines that assist the driver in doing so.) 68 * routines that assist the driver in doing so.)
69 */ 69 */
70 70
71#include <sys/cdefs.h> 71#include <sys/cdefs.h>
72__KERNEL_RCSID(0, "$NetBSD: dvma.c,v 1.40 2009/11/21 04:16:53 rmind Exp $"); 72__KERNEL_RCSID(0, "$NetBSD: dvma.c,v 1.41 2012/01/27 18:53:04 para Exp $");
73 73
74#include <sys/param.h> 74#include <sys/param.h>
75#include <sys/systm.h> 75#include <sys/systm.h>
76#include <sys/device.h> 76#include <sys/device.h>
77#include <sys/proc.h> 77#include <sys/proc.h>
78#include <sys/malloc.h> 78#include <sys/malloc.h>
79#include <sys/extent.h> 79#include <sys/extent.h>
80#include <sys/buf.h> 80#include <sys/buf.h>
81#include <sys/vnode.h> 81#include <sys/vnode.h>
82#include <sys/core.h> 82#include <sys/core.h>
83#include <sys/exec.h> 83#include <sys/exec.h>
84 84
85#include <uvm/uvm_extern.h> 85#include <uvm/uvm_extern.h>
@@ -104,27 +104,27 @@ __KERNEL_RCSID(0, "$NetBSD: dvma.c,v 1.4 @@ -104,27 +104,27 @@ __KERNEL_RCSID(0, "$NetBSD: dvma.c,v 1.4
104 */ 104 */
105 105
106/* Number of slots in dvmamap. */ 106/* Number of slots in dvmamap. */
107struct extent *dvma_extent; 107struct extent *dvma_extent;
108 108
109void  109void
110dvma_init(void) 110dvma_init(void)
111{ 111{
112 112
113 /* 113 /*
114 * Create the extent map for DVMA pages. 114 * Create the extent map for DVMA pages.
115 */ 115 */
116 dvma_extent = extent_create("dvma", DVMA_MAP_BASE, 116 dvma_extent = extent_create("dvma", DVMA_MAP_BASE,
117 DVMA_MAP_BASE + (DVMA_MAP_AVAIL - 1), M_DEVBUF, 117 DVMA_MAP_BASE + (DVMA_MAP_AVAIL - 1),
118 NULL, 0, EX_NOCOALESCE|EX_NOWAIT); 118 NULL, 0, EX_NOCOALESCE|EX_NOWAIT);
119 119
120 /* 120 /*
121 * Enable DVMA in the System Enable register. 121 * Enable DVMA in the System Enable register.
122 * Note: This is only necessary for VME slave accesses. 122 * Note: This is only necessary for VME slave accesses.
123 * On-board devices are always capable of DVMA. 123 * On-board devices are always capable of DVMA.
124 */ 124 */
125 *enable_reg |= ENA_SDVMA; 125 *enable_reg |= ENA_SDVMA;
126} 126}
127 127
128 128
129/* 129/*
130 * Given a DVMA address, return the physical address that 130 * Given a DVMA address, return the physical address that

cvs diff -r1.184 -r1.185 src/sys/arch/vax/vax/machdep.c (expand / switch to unified diff)

--- src/sys/arch/vax/vax/machdep.c 2012/01/07 16:47:42 1.184
+++ src/sys/arch/vax/vax/machdep.c 2012/01/27 18:53:05 1.185
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.184 2012/01/07 16:47:42 chs Exp $ */ 1/* $NetBSD: machdep.c,v 1.185 2012/01/27 18:53:05 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. 4 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 *  6 *
7 * Changed for the VAX port (and for readability) /IC 7 * Changed for the VAX port (and for readability) /IC
8 *  8 *
9 * This code is derived from software contributed to Berkeley by the Systems 9 * This code is derived from software contributed to Berkeley by the Systems
10 * Programming Group of the University of Utah Computer Science Department. 10 * Programming Group of the University of Utah Computer Science Department.
11 *  11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -73,27 +73,27 @@ @@ -73,27 +73,27 @@
73 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 73 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
74 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 74 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
75 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 75 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
76 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 76 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
77 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 77 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
78 * SUCH DAMAGE. 78 * SUCH DAMAGE.
79 *  79 *
80 * from: Utah Hdr: machdep.c 1.63 91/04/24 80 * from: Utah Hdr: machdep.c 1.63 91/04/24
81 *  81 *
82 * @(#)machdep.c 7.16 (Berkeley) 6/3/91 82 * @(#)machdep.c 7.16 (Berkeley) 6/3/91
83 */ 83 */
84 84
85#include <sys/cdefs.h> 85#include <sys/cdefs.h>
86__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.184 2012/01/07 16:47:42 chs Exp $"); 86__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.185 2012/01/27 18:53:05 para Exp $");
87 87
88#include "opt_ddb.h" 88#include "opt_ddb.h"
89#include "opt_compat_netbsd.h" 89#include "opt_compat_netbsd.h"
90#include "opt_compat_ultrix.h" 90#include "opt_compat_ultrix.h"
91#include "opt_modular.h" 91#include "opt_modular.h"
92#include "opt_multiprocessor.h" 92#include "opt_multiprocessor.h"
93#include "opt_lockdebug.h" 93#include "opt_lockdebug.h"
94#include "opt_compat_ibcs2.h" 94#include "opt_compat_ibcs2.h"
95 95
96#include <sys/param.h> 96#include <sys/param.h>
97#include <sys/systm.h> 97#include <sys/systm.h>
98#include <sys/buf.h> 98#include <sys/buf.h>
99#include <sys/conf.h> 99#include <sys/conf.h>
@@ -299,27 +299,27 @@ void @@ -299,27 +299,27 @@ void
299consinit(void) 299consinit(void)
300{ 300{
301 extern vaddr_t iospace; 301 extern vaddr_t iospace;
302 302
303 /* 303 /*
304 * Init I/O memory extent map. Must be done before cninit() 304 * Init I/O memory extent map. Must be done before cninit()
305 * is called; we may want to use iospace in the console routines. 305 * is called; we may want to use iospace in the console routines.
306 * 306 *
307 * NOTE: We need to reserve the first vax-page of iospace 307 * NOTE: We need to reserve the first vax-page of iospace
308 * for the console routines. 308 * for the console routines.
309 */ 309 */
310 KASSERT(iospace != 0); 310 KASSERT(iospace != 0);
311 iomap_ex = extent_create("iomap", iospace + VAX_NBPG, 311 iomap_ex = extent_create("iomap", iospace + VAX_NBPG,
312 iospace + ((IOSPSZ * VAX_NBPG) - 1), M_DEVBUF, 312 iospace + ((IOSPSZ * VAX_NBPG) - 1),
313 (void *) iomap_ex_storage, sizeof(iomap_ex_storage), 313 (void *) iomap_ex_storage, sizeof(iomap_ex_storage),
314 EX_NOCOALESCE|EX_NOWAIT); 314 EX_NOCOALESCE|EX_NOWAIT);
315#ifdef DEBUG 315#ifdef DEBUG
316 iospace_inited = 1; 316 iospace_inited = 1;
317#endif 317#endif
318 cninit(); 318 cninit();
319#if NKSYMS || defined(DDB) || defined(MODULAR) 319#if NKSYMS || defined(DDB) || defined(MODULAR)
320 if (symtab_start != NULL && symtab_nsyms != 0 && symtab_end != NULL) { 320 if (symtab_start != NULL && symtab_nsyms != 0 && symtab_end != NULL) {
321 ksyms_addsyms_elf(symtab_nsyms, symtab_start, symtab_end); 321 ksyms_addsyms_elf(symtab_nsyms, symtab_start, symtab_end);
322 } 322 }
323#endif 323#endif
324#ifdef DEBUG 324#ifdef DEBUG
325 if (sizeof(struct pcb) > REDZONEADDR) 325 if (sizeof(struct pcb) > REDZONEADDR)

cvs diff -r1.16 -r1.17 src/sys/arch/vax/vax/sgmap.c (expand / switch to unified diff)

--- src/sys/arch/vax/vax/sgmap.c 2010/12/14 23:44:50 1.16
+++ src/sys/arch/vax/vax/sgmap.c 2012/01/27 18:53:06 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sgmap.c,v 1.16 2010/12/14 23:44:50 matt Exp $ */ 1/* $NetBSD: sgmap.c,v 1.17 2012/01/27 18:53:06 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: sgmap.c,v 1.16 2010/12/14 23:44:50 matt Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: sgmap.c,v 1.17 2012/01/27 18:53:06 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/bus.h> 38#include <sys/bus.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/proc.h> 40#include <sys/proc.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42 42
43#include <uvm/uvm_extern.h> 43#include <uvm/uvm_extern.h>
44 44
45#include <machine/sgmap.h> 45#include <machine/sgmap.h>
46 46
47void 47void
@@ -83,27 +83,27 @@ vax_sgmap_init(bus_dma_tag_t t, struct v @@ -83,27 +83,27 @@ vax_sgmap_init(bus_dma_tag_t t, struct v
83 BUS_DMA_NOWAIT)) { 83 BUS_DMA_NOWAIT)) {
84 panic("unable to allocate page table for sgmap `%s'", 84 panic("unable to allocate page table for sgmap `%s'",
85 name); 85 name);
86 goto die; 86 goto die;
87 } 87 }
88 sgmap->aps_pt = (struct pte *)(seg.ds_addr | KERNBASE); 88 sgmap->aps_pt = (struct pte *)(seg.ds_addr | KERNBASE);
89 } 89 }
90 90
91 /* 91 /*
92 * Create the extent map used to manage the virtual address 92 * Create the extent map used to manage the virtual address
93 * space. 93 * space.
94 */ 94 */
95 sgmap->aps_ex = extent_create(name, sgvabase, sgvasize - 1, 95 sgmap->aps_ex = extent_create(name, sgvabase, sgvasize - 1,
96 M_DMAMAP, NULL, 0, EX_NOWAIT|EX_NOCOALESCE); 96 NULL, 0, EX_NOWAIT|EX_NOCOALESCE);
97 if (sgmap->aps_ex == NULL) { 97 if (sgmap->aps_ex == NULL) {
98 printf("unable to create extent map for sgmap `%s'\n", name); 98 printf("unable to create extent map for sgmap `%s'\n", name);
99 goto die; 99 goto die;
100 } 100 }
101 101
102 return; 102 return;
103 die: 103 die:
104 panic("vax_sgmap_init"); 104 panic("vax_sgmap_init");
105} 105}
106 106
107int 107int
108vax_sgmap_alloc(bus_dmamap_t map, bus_size_t origlen, struct vax_sgmap *sgmap, 108vax_sgmap_alloc(bus_dmamap_t map, bus_size_t origlen, struct vax_sgmap *sgmap,
109 int flags) 109 int flags)

cvs diff -r1.42 -r1.43 src/sys/arch/x68k/dev/intio.c (expand / switch to unified diff)

--- src/sys/arch/x68k/dev/intio.c 2009/01/18 05:00:39 1.42
+++ src/sys/arch/x68k/dev/intio.c 2012/01/27 18:53:06 1.43
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: intio.c,v 1.42 2009/01/18 05:00:39 isaki Exp $ */ 1/* $NetBSD: intio.c,v 1.43 2012/01/27 18:53:06 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29/* 29/*
30 * NetBSD/x68k internal I/O virtual bus. 30 * NetBSD/x68k internal I/O virtual bus.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.42 2009/01/18 05:00:39 isaki Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.43 2012/01/27 18:53:06 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40#include <sys/mbuf.h> 40#include <sys/mbuf.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42#include <uvm/uvm_extern.h> 42#include <uvm/uvm_extern.h>
43 43
44#include <machine/bus.h> 44#include <machine/bus.h>
45#include <machine/cpu.h> 45#include <machine/cpu.h>
46#include <machine/frame.h> 46#include <machine/frame.h>
47 47
@@ -152,27 +152,27 @@ intio_match(device_t parent, cfdata_t cf @@ -152,27 +152,27 @@ intio_match(device_t parent, cfdata_t cf
152static void 152static void
153intio_attach(device_t parent, device_t self, void *aux) 153intio_attach(device_t parent, device_t self, void *aux)
154{ 154{
155 struct intio_softc *sc = device_private(self); 155 struct intio_softc *sc = device_private(self);
156 struct intio_attach_args ia; 156 struct intio_attach_args ia;
157 157
158 intio_attached = 1; 158 intio_attached = 1;
159 159
160 aprint_normal(" mapped at %8p\n", intiobase); 160 aprint_normal(" mapped at %8p\n", intiobase);
161 161
162 sc->sc_map = extent_create("intiomap", 162 sc->sc_map = extent_create("intiomap",
163 INTIOBASE, 163 INTIOBASE,
164 INTIOBASE + 0x400000, 164 INTIOBASE + 0x400000,
165 M_DEVBUF, NULL, 0, EX_NOWAIT); 165 NULL, 0, EX_NOWAIT);
166 intio_alloc_system_ports(sc); 166 intio_alloc_system_ports(sc);
167 167
168 sc->sc_bst = &intio_bus; 168 sc->sc_bst = &intio_bus;
169 sc->sc_bst->x68k_bus_device = self; 169 sc->sc_bst->x68k_bus_device = self;
170 sc->sc_dmat = &intio_bus_dma; 170 sc->sc_dmat = &intio_bus_dma;
171 sc->sc_dmac = 0; 171 sc->sc_dmac = 0;
172 172
173 memset(iiv, 0, sizeof(struct intio_interrupt_vector) * 256); 173 memset(iiv, 0, sizeof(struct intio_interrupt_vector) * 256);
174 174
175 ia.ia_bst = sc->sc_bst; 175 ia.ia_bst = sc->sc_bst;
176 ia.ia_dmat = sc->sc_dmat; 176 ia.ia_dmat = sc->sc_dmat;
177 177
178 config_search_ia(intio_search, self, "intio", &ia); 178 config_search_ia(intio_search, self, "intio", &ia);

cvs diff -r1.8 -r1.9 src/sys/arch/x86/pci/pci_addr_fixup.c (expand / switch to unified diff)

--- src/sys/arch/x86/pci/pci_addr_fixup.c 2011/08/28 06:08:15 1.8
+++ src/sys/arch/x86/pci/pci_addr_fixup.c 2012/01/27 18:53:06 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pci_addr_fixup.c,v 1.8 2011/08/28 06:08:15 dyoung Exp $ */ 1/* $NetBSD: pci_addr_fixup.c,v 1.9 2012/01/27 18:53:06 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 UCHIYAMA Yasushi. All rights reserved. 4 * Copyright (c) 2000 UCHIYAMA Yasushi. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products 14 * 3. The name of the author may not be used to endorse or promote products
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: pci_addr_fixup.c,v 1.8 2011/08/28 06:08:15 dyoung Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: pci_addr_fixup.c,v 1.9 2012/01/27 18:53:06 para Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/malloc.h> 34#include <sys/malloc.h>
35#include <sys/kernel.h> 35#include <sys/kernel.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/extent.h> 37#include <sys/extent.h>
38 38
39#include <sys/bus.h> 39#include <sys/bus.h>
40 40
41#include <dev/pci/pcireg.h> 41#include <dev/pci/pcireg.h>
42#include <dev/pci/pcivar.h> 42#include <dev/pci/pcivar.h>
43#include <dev/pci/pcidevs.h> 43#include <dev/pci/pcidevs.h>
@@ -80,32 +80,32 @@ pci_addr_fixup(pci_chipset_tag_t pc, int @@ -80,32 +80,32 @@ pci_addr_fixup(pci_chipset_tag_t pc, int
80 const char *name; 80 const char *name;
81 } system_reserve [] = { 81 } system_reserve [] = {
82 { 0xfec00000, 0x100000, "I/O APIC" }, 82 { 0xfec00000, 0x100000, "I/O APIC" },
83 { 0xfee00000, 0x100000, "Local APIC" }, 83 { 0xfee00000, 0x100000, "Local APIC" },
84 { 0xfffe0000, 0x20000, "BIOS PROM" }, 84 { 0xfffe0000, 0x20000, "BIOS PROM" },
85 { 0, 0, 0 }, /* terminator */ 85 { 0, 0, 0 }, /* terminator */
86 }, *srp; 86 }, *srp;
87 paddr_t start; 87 paddr_t start;
88 int error; 88 int error;
89 89
90 pciaddr.extent_mem = extent_create("PCI I/O memory space", 90 pciaddr.extent_mem = extent_create("PCI I/O memory space",
91 PCIADDR_MEM_START, 91 PCIADDR_MEM_START,
92 PCIADDR_MEM_END, 92 PCIADDR_MEM_END,
93 M_DEVBUF, 0, 0, EX_NOWAIT); 93 0, 0, EX_NOWAIT);
94 KASSERT(pciaddr.extent_mem); 94 KASSERT(pciaddr.extent_mem);
95 pciaddr.extent_port = extent_create("PCI I/O port space", 95 pciaddr.extent_port = extent_create("PCI I/O port space",
96 PCIADDR_PORT_START, 96 PCIADDR_PORT_START,
97 PCIADDR_PORT_END, 97 PCIADDR_PORT_END,
98 M_DEVBUF, 0, 0, EX_NOWAIT); 98 0, 0, EX_NOWAIT);
99 KASSERT(pciaddr.extent_port); 99 KASSERT(pciaddr.extent_port);
100 100
101 /* 101 /*
102 * 1. check & reserve system BIOS setting. 102 * 1. check & reserve system BIOS setting.
103 */ 103 */
104 aprint_debug(verbose_header, "System BIOS Setting"); 104 aprint_debug(verbose_header, "System BIOS Setting");
105 pci_device_foreach(pc, maxbus, pciaddr_resource_reserve, NULL); 105 pci_device_foreach(pc, maxbus, pciaddr_resource_reserve, NULL);
106 aprint_debug(verbose_footer, pciaddr.nbogus); 106 aprint_debug(verbose_footer, pciaddr.nbogus);
107 107
108 /* 108 /*
109 * 2. reserve non-PCI area. 109 * 2. reserve non-PCI area.
110 */ 110 */
111 for (srp = system_reserve; srp->size; srp++) { 111 for (srp = system_reserve; srp->size; srp++) {

cvs diff -r1.37 -r1.38 src/sys/arch/x86/x86/bus_space.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/bus_space.c 2011/08/25 15:08:49 1.37
+++ src/sys/arch/x86/x86/bus_space.c 2012/01/27 18:53:07 1.38
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bus_space.c,v 1.37 2011/08/25 15:08:49 dyoung Exp $ */ 1/* $NetBSD: bus_space.c,v 1.38 2012/01/27 18:53:07 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace 8 * by Charles M. Hannum and by Jason R. Thorpe of the Numerical Aerospace
9 * Simulation Facility, NASA Ames Research Center. 9 * Simulation Facility, NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.37 2011/08/25 15:08:49 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.38 2012/01/27 18:53:07 para Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/extent.h> 39#include <sys/extent.h>
40#include <sys/kmem.h> 40#include <sys/kmem.h>
41 41
42#include <uvm/uvm_extern.h> 42#include <uvm/uvm_extern.h>
43 43
44#include <dev/isa/isareg.h> 44#include <dev/isa/isareg.h>
45 45
46#include <sys/bus.h> 46#include <sys/bus.h>
47#include <machine/pio.h> 47#include <machine/pio.h>
@@ -116,30 +116,30 @@ void @@ -116,30 +116,30 @@ void
116x86_bus_space_init(void) 116x86_bus_space_init(void)
117{ 117{
118 /* 118 /*
119 * Initialize the I/O port and I/O mem extent maps. 119 * Initialize the I/O port and I/O mem extent maps.
120 * Note: we don't have to check the return value since 120 * Note: we don't have to check the return value since
121 * creation of a fixed extent map will never fail (since 121 * creation of a fixed extent map will never fail (since
122 * descriptor storage has already been allocated). 122 * descriptor storage has already been allocated).
123 * 123 *
124 * N.B. The iomem extent manages _all_ physical addresses 124 * N.B. The iomem extent manages _all_ physical addresses
125 * on the machine. When the amount of RAM is found, the two 125 * on the machine. When the amount of RAM is found, the two
126 * extents of RAM are allocated from the map (0 -> ISA hole 126 * extents of RAM are allocated from the map (0 -> ISA hole
127 * and end of ISA hole -> end of RAM). 127 * and end of ISA hole -> end of RAM).
128 */ 128 */
129 ioport_ex = extent_create("ioport", 0x0, 0xffff, M_DEVBUF, 129 ioport_ex = extent_create("ioport", 0x0, 0xffff,
130 (void *)ioport_ex_storage, sizeof(ioport_ex_storage), 130 (void *)ioport_ex_storage, sizeof(ioport_ex_storage),
131 EX_NOCOALESCE|EX_NOWAIT); 131 EX_NOCOALESCE|EX_NOWAIT);
132 iomem_ex = extent_create("iomem", 0x0, 0xffffffff, M_DEVBUF, 132 iomem_ex = extent_create("iomem", 0x0, 0xffffffff,
133 (void *)iomem_ex_storage, sizeof(iomem_ex_storage), 133 (void *)iomem_ex_storage, sizeof(iomem_ex_storage),
134 EX_NOCOALESCE|EX_NOWAIT); 134 EX_NOCOALESCE|EX_NOWAIT);
135 135
136#ifdef XEN 136#ifdef XEN
137 /* We are privileged guest os - should have IO privileges. */ 137 /* We are privileged guest os - should have IO privileges. */
138 if (xendomain_is_privileged()) { 138 if (xendomain_is_privileged()) {
139 struct physdev_op physop; 139 struct physdev_op physop;
140 physop.cmd = PHYSDEVOP_SET_IOPL; 140 physop.cmd = PHYSDEVOP_SET_IOPL;
141 physop.u.set_iopl.iopl = 1; 141 physop.u.set_iopl.iopl = 1;
142 if (HYPERVISOR_physdev_op(&physop) != 0) 142 if (HYPERVISOR_physdev_op(&physop) != 0)
143 panic("Unable to obtain IOPL, " 143 panic("Unable to obtain IOPL, "
144 "despite being SIF_PRIVILEGED"); 144 "despite being SIF_PRIVILEGED");
145 } 145 }

cvs diff -r1.28 -r1.29 src/sys/dev/cardbus/rbus.c (expand / switch to unified diff)

--- src/sys/dev/cardbus/rbus.c 2009/12/15 22:17:12 1.28
+++ src/sys/dev/cardbus/rbus.c 2012/01/27 18:53:07 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rbus.c,v 1.28 2009/12/15 22:17:12 snj Exp $ */ 1/* $NetBSD: rbus.c,v 1.29 2012/01/27 18:53:07 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 and 2000 4 * Copyright (c) 1999 and 2000
5 * HAYAKAWA Koichi. All rights reserved. 5 * HAYAKAWA Koichi. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: rbus.c,v 1.28 2009/12/15 22:17:12 snj Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: rbus.c,v 1.29 2012/01/27 18:53:07 para Exp $");
30 30
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/systm.h> 32#include <sys/systm.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/malloc.h> 34#include <sys/malloc.h>
35#include <sys/extent.h> 35#include <sys/extent.h>
36 36
37#include <sys/bus.h> 37#include <sys/bus.h>
38 38
39#include <dev/cardbus/rbus.h> 39#include <dev/cardbus/rbus.h>
40 40
41/* #define RBUS_DEBUG */ 41/* #define RBUS_DEBUG */
42 42
@@ -248,27 +248,27 @@ rbus_new_body(bus_space_tag_t bt, rbus_t @@ -248,27 +248,27 @@ rbus_new_body(bus_space_tag_t bt, rbus_t
248 * 248 *
249 * This function makes a new child rbus instance. 249 * This function makes a new child rbus instance.
250 */ 250 */
251rbus_tag_t 251rbus_tag_t
252rbus_new(rbus_tag_t parent, bus_addr_t start, bus_size_t size, bus_addr_t offset, int flags) 252rbus_new(rbus_tag_t parent, bus_addr_t start, bus_size_t size, bus_addr_t offset, int flags)
253{ 253{
254 rbus_tag_t rb; 254 rbus_tag_t rb;
255 struct extent *ex = NULL; 255 struct extent *ex = NULL;
256 bus_addr_t end = start + size; 256 bus_addr_t end = start + size;
257 257
258 if (flags == RBUS_SPACE_SHARE) { 258 if (flags == RBUS_SPACE_SHARE) {
259 ex = parent->rb_ext; 259 ex = parent->rb_ext;
260 } else if (flags == RBUS_SPACE_DEDICATE) { 260 } else if (flags == RBUS_SPACE_DEDICATE) {
261 if (NULL == (ex = extent_create("rbus", start, end, M_DEVBUF, 261 if (NULL == (ex = extent_create("rbus", start, end,
262 NULL, 0, EX_NOCOALESCE|EX_NOWAIT))) { 262 NULL, 0, EX_NOCOALESCE|EX_NOWAIT))) {
263 return NULL; 263 return NULL;
264 } 264 }
265 } else if (flags == RBUS_SPACE_ASK_PARENT) { 265 } else if (flags == RBUS_SPACE_ASK_PARENT) {
266 ex = NULL; 266 ex = NULL;
267 } else { 267 } else {
268 /* Invalid flag */ 268 /* Invalid flag */
269 return 0; 269 return 0;
270 } 270 }
271 271
272 rb = rbus_new_body(parent->rb_bt, parent, ex, start, start + size, 272 rb = rbus_new_body(parent->rb_bt, parent, ex, start, start + size,
273 offset, flags); 273 offset, flags);
274 274
@@ -285,27 +285,27 @@ rbus_new(rbus_tag_t parent, bus_addr_t s @@ -285,27 +285,27 @@ rbus_new(rbus_tag_t parent, bus_addr_t s
285/* 285/*
286 * rbus_tag_t rbus_new_root_delegate(bus_space_tag, bus_addr_t, 286 * rbus_tag_t rbus_new_root_delegate(bus_space_tag, bus_addr_t,
287 * bus_size_t, bus_addr_t offset) 287 * bus_size_t, bus_addr_t offset)
288 * 288 *
289 * This function makes a root rbus instance. 289 * This function makes a root rbus instance.
290 */ 290 */
291rbus_tag_t 291rbus_tag_t
292rbus_new_root_delegate(bus_space_tag_t bt, bus_addr_t start, bus_size_t size, bus_addr_t offset) 292rbus_new_root_delegate(bus_space_tag_t bt, bus_addr_t start, bus_size_t size, bus_addr_t offset)
293{ 293{
294 rbus_tag_t rb; 294 rbus_tag_t rb;
295 struct extent *ex; 295 struct extent *ex;
296 296
297 if (NULL == (ex = extent_create("rbus root", start, start + size, 297 if (NULL == (ex = extent_create("rbus root", start, start + size,
298 M_DEVBUF, NULL, 0, EX_NOCOALESCE|EX_NOWAIT))) { 298 NULL, 0, EX_NOCOALESCE|EX_NOWAIT))) {
299 return NULL; 299 return NULL;
300 } 300 }
301 301
302 rb = rbus_new_body(bt, NULL, ex, start, start + size, offset, 302 rb = rbus_new_body(bt, NULL, ex, start, start + size, offset,
303 RBUS_SPACE_DEDICATE); 303 RBUS_SPACE_DEDICATE);
304 304
305 if (rb == NULL) { 305 if (rb == NULL) {
306 extent_destroy(ex); 306 extent_destroy(ex);
307 } 307 }
308 308
309 return rb; 309 return rb;
310} 310}
311 311

cvs diff -r1.18 -r1.19 src/sys/dev/ic/cpc700.c (expand / switch to unified diff)

--- src/sys/dev/ic/cpc700.c 2011/05/17 17:34:54 1.18
+++ src/sys/dev/ic/cpc700.c 2012/01/27 18:53:07 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpc700.c,v 1.18 2011/05/17 17:34:54 dyoung Exp $ */ 1/* $NetBSD: cpc700.c,v 1.19 2012/01/27 18:53:07 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp. 8 * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -40,27 +40,27 @@ @@ -40,27 +40,27 @@
40 * - two IIC ports 40 * - two IIC ports
41 * 41 *
42 * This driver handles the overall device and enumeration of the 42 * This driver handles the overall device and enumeration of the
43 * supported subdevices. NetBSD knows how to handle: 43 * supported subdevices. NetBSD knows how to handle:
44 * - PCI master 44 * - PCI master
45 * - interrupt controller 45 * - interrupt controller
46 * - UARTs 46 * - UARTs
47 * Skeleton drivers are provided for the timer and IIC. 47 * Skeleton drivers are provided for the timer and IIC.
48 * 48 *
49 * XXX This driver assumes that there is only one instance of it. 49 * XXX This driver assumes that there is only one instance of it.
50 */ 50 */
51 51
52#include <sys/cdefs.h> 52#include <sys/cdefs.h>
53__KERNEL_RCSID(0, "$NetBSD: cpc700.c,v 1.18 2011/05/17 17:34:54 dyoung Exp $"); 53__KERNEL_RCSID(0, "$NetBSD: cpc700.c,v 1.19 2012/01/27 18:53:07 para Exp $");
54 54
55#include "pci.h" 55#include "pci.h"
56#include "opt_pci.h" 56#include "opt_pci.h"
57 57
58#include <sys/param.h> 58#include <sys/param.h>
59#include <sys/extent.h> 59#include <sys/extent.h>
60#include <sys/device.h> 60#include <sys/device.h>
61#include <sys/malloc.h> 61#include <sys/malloc.h>
62#include <sys/systm.h> 62#include <sys/systm.h>
63 63
64#include <sys/bus.h> 64#include <sys/bus.h>
65#include "locators.h" 65#include "locators.h"
66 66
@@ -181,29 +181,29 @@ cpc_attach(device_t self, pci_chipset_ta @@ -181,29 +181,29 @@ cpc_attach(device_t self, pci_chipset_ta
181 erren = pci_conf_read(pc, tag, CPC_PCI_BRDGERR); 181 erren = pci_conf_read(pc, tag, CPC_PCI_BRDGERR);
182 /* Don't generate errors during probe. */ 182 /* Don't generate errors during probe. */
183 pci_conf_write(pc, tag, CPC_PCI_BRDGERR, 0); 183 pci_conf_write(pc, tag, CPC_PCI_BRDGERR, 0);
184 184
185 /* Program MITL */ 185 /* Program MITL */
186 v = pci_conf_read(pc, tag, CPC_BRIDGE_OPTIONS2); 186 v = pci_conf_read(pc, tag, CPC_BRIDGE_OPTIONS2);
187 v &= ~(CPC_BRIDGE_O2_ILAT_MASK | CPC_BRIDGE_O2_SLAT_MASK); 187 v &= ~(CPC_BRIDGE_O2_ILAT_MASK | CPC_BRIDGE_O2_SLAT_MASK);
188 v |= (CPC_BRIDGE_O2_ILAT_PRIM_ASYNC << CPC_BRIDGE_O2_ILAT_SHIFT) | 188 v |= (CPC_BRIDGE_O2_ILAT_PRIM_ASYNC << CPC_BRIDGE_O2_ILAT_SHIFT) |
189 (CPC_BRIDGE_O2_2LAT_PRIM_ASYNC << CPC_BRIDGE_O2_SLAT_SHIFT); 189 (CPC_BRIDGE_O2_2LAT_PRIM_ASYNC << CPC_BRIDGE_O2_SLAT_SHIFT);
190 pci_conf_write(pc, tag, CPC_BRIDGE_OPTIONS2, v); 190 pci_conf_write(pc, tag, CPC_BRIDGE_OPTIONS2, v);
191 191
192#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE) 192#if NPCI > 0 && defined(PCI_NETBSD_CONFIGURE)
193 ioext = extent_create("pciio", CPC_PCI_IO_START, CPC_PCI_IO_END, 193 ioext = extent_create("pciio", CPC_PCI_IO_START, CPC_PCI_IO_END,
194 M_DEVBUF, NULL, 0, EX_NOWAIT); 194 NULL, 0, EX_NOWAIT);
195 memext = extent_create("pcimem", CPC_PCI_MEM_BASE, CPC_PCI_MEM_END, 195 memext = extent_create("pcimem", CPC_PCI_MEM_BASE, CPC_PCI_MEM_END,
196 M_DEVBUF, NULL, 0, EX_NOWAIT); 196 NULL, 0, EX_NOWAIT);
197 197
198 pci_configure_bus(0, ioext, memext, NULL, 0, 32); 198 pci_configure_bus(0, ioext, memext, NULL, 0, 32);
199 199
200 extent_destroy(ioext); 200 extent_destroy(ioext);
201 extent_destroy(memext); 201 extent_destroy(memext);
202#endif 202#endif
203 203
204 config_found_ia(self, "pcibus", &aa.pba, pcibusprint); 204 config_found_ia(self, "pcibus", &aa.pba, pcibusprint);
205 205
206 /* Restore error triggers, and clear errors */ 206 /* Restore error triggers, and clear errors */
207 pci_conf_write(pc, tag, CPC_PCI_BRDGERR, erren | CPC_PCI_CLEARERR); 207 pci_conf_write(pc, tag, CPC_PCI_BRDGERR, erren | CPC_PCI_CLEARERR);
208} 208}
209 209

cvs diff -r1.28 -r1.29 src/sys/dev/marvell/gtpci.c (expand / switch to unified diff)

--- src/sys/dev/marvell/gtpci.c 2011/05/17 17:34:54 1.28
+++ src/sys/dev/marvell/gtpci.c 2012/01/27 18:53:08 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gtpci.c,v 1.28 2011/05/17 17:34:54 dyoung Exp $ */ 1/* $NetBSD: gtpci.c,v 1.29 2012/01/27 18:53:08 para Exp $ */
2/* 2/*
3 * Copyright (c) 2008, 2009 KIYOHARA Takashi 3 * Copyright (c) 2008, 2009 KIYOHARA Takashi
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.28 2011/05/17 17:34:54 dyoung Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.29 2012/01/27 18:53:08 para Exp $");
30 30
31#include "opt_pci.h" 31#include "opt_pci.h"
32#include "pci.h" 32#include "pci.h"
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/bus.h> 35#include <sys/bus.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/errno.h> 37#include <sys/errno.h>
38#include <sys/extent.h> 38#include <sys/extent.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40 40
41#include <prop/proplib.h> 41#include <prop/proplib.h>
42 42
@@ -444,30 +444,28 @@ gtpci_pci_config(struct gtpci_softc *sc, @@ -444,30 +444,28 @@ gtpci_pci_config(struct gtpci_softc *sc,
444 bus_space_tag_t memt, bus_dma_tag_t dmat, pci_chipset_tag_t pc, 444 bus_space_tag_t memt, bus_dma_tag_t dmat, pci_chipset_tag_t pc,
445 u_long iostart, u_long ioend, u_long memstart, u_long memend, 445 u_long iostart, u_long ioend, u_long memstart, u_long memend,
446 int cacheline_size) 446 int cacheline_size)
447{ 447{
448 struct pcibus_attach_args pba; 448 struct pcibus_attach_args pba;
449#ifdef PCI_NETBSD_CONFIGURE 449#ifdef PCI_NETBSD_CONFIGURE
450 struct extent *ioext = NULL, *memext = NULL; 450 struct extent *ioext = NULL, *memext = NULL;
451#endif 451#endif
452 uint32_t p2pc, command; 452 uint32_t p2pc, command;
453 453
454 p2pc = GTPCI_READ(sc, GTPCI_P2PC); 454 p2pc = GTPCI_READ(sc, GTPCI_P2PC);
455 455
456#ifdef PCI_NETBSD_CONFIGURE 456#ifdef PCI_NETBSD_CONFIGURE
457 ioext = extent_create("pciio", iostart, ioend, M_DEVBUF, NULL, 0, 457 ioext = extent_create("pciio", iostart, ioend, NULL, 0, EX_NOWAIT);
458 EX_NOWAIT); 458 memext = extent_create("pcimem", memstart, memend, NULL, 0, EX_NOWAIT);
459 memext = extent_create("pcimem", memstart, memend, M_DEVBUF, NULL, 0, 
460 EX_NOWAIT); 
461 if (ioext != NULL && memext != NULL) 459 if (ioext != NULL && memext != NULL)
462 pci_configure_bus(pc, ioext, memext, NULL, 460 pci_configure_bus(pc, ioext, memext, NULL,
463 GTPCI_P2PC_BUSNUMBER(p2pc), cacheline_size); 461 GTPCI_P2PC_BUSNUMBER(p2pc), cacheline_size);
464 else 462 else
465 aprint_error_dev(sc->sc_dev, "can't create extent %s%s%s\n", 463 aprint_error_dev(sc->sc_dev, "can't create extent %s%s%s\n",
466 ioext == NULL ? "io" : "", 464 ioext == NULL ? "io" : "",
467 ioext == NULL && memext == NULL ? " and " : "", 465 ioext == NULL && memext == NULL ? " and " : "",
468 memext == NULL ? "mem" : ""); 466 memext == NULL ? "mem" : "");
469 if (ioext != NULL) 467 if (ioext != NULL)
470 extent_destroy(ioext); 468 extent_destroy(ioext);
471 if (memext != NULL) 469 if (memext != NULL)
472 extent_destroy(memext); 470 extent_destroy(memext);
473#endif 471#endif

cvs diff -r1.5 -r1.6 src/sys/dev/marvell/mvpex.c (expand / switch to unified diff)

--- src/sys/dev/marvell/mvpex.c 2011/05/17 17:34:54 1.5
+++ src/sys/dev/marvell/mvpex.c 2012/01/27 18:53:08 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mvpex.c,v 1.5 2011/05/17 17:34:54 dyoung Exp $ */ 1/* $NetBSD: mvpex.c,v 1.6 2012/01/27 18:53:08 para Exp $ */
2/* 2/*
3 * Copyright (c) 2008 KIYOHARA Takashi 3 * Copyright (c) 2008 KIYOHARA Takashi
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: mvpex.c,v 1.5 2011/05/17 17:34:54 dyoung Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: mvpex.c,v 1.6 2012/01/27 18:53:08 para Exp $");
30 30
31#include "opt_pci.h" 31#include "opt_pci.h"
32#include "pci.h" 32#include "pci.h"
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/bus.h> 35#include <sys/bus.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/errno.h> 37#include <sys/errno.h>
38#include <sys/extent.h> 38#include <sys/extent.h>
39#include <sys/evcnt.h> 39#include <sys/evcnt.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42 42
@@ -407,30 +407,28 @@ mvpex_pci_config(struct mvpex_softc *sc, @@ -407,30 +407,28 @@ mvpex_pci_config(struct mvpex_softc *sc,
407 bus_space_tag_t memt, bus_dma_tag_t dmat, pci_chipset_tag_t pc, 407 bus_space_tag_t memt, bus_dma_tag_t dmat, pci_chipset_tag_t pc,
408 u_long iostart, u_long ioend, u_long memstart, u_long memend, 408 u_long iostart, u_long ioend, u_long memstart, u_long memend,
409 int cacheline_size) 409 int cacheline_size)
410{ 410{
411 struct pcibus_attach_args pba; 411 struct pcibus_attach_args pba;
412#ifdef PCI_NETBSD_CONFIGURE 412#ifdef PCI_NETBSD_CONFIGURE
413 struct extent *ioext = NULL, *memext = NULL; 413 struct extent *ioext = NULL, *memext = NULL;
414#endif 414#endif
415 uint32_t stat; 415 uint32_t stat;
416 416
417 stat = bus_space_read_4(sc->sc_iot, sc->sc_ioh, MVPEX_STAT); 417 stat = bus_space_read_4(sc->sc_iot, sc->sc_ioh, MVPEX_STAT);
418 418
419#ifdef PCI_NETBSD_CONFIGURE 419#ifdef PCI_NETBSD_CONFIGURE
420 ioext = extent_create("pexio", iostart, ioend, M_DEVBUF, NULL, 0, 420 ioext = extent_create("pexio", iostart, ioend, NULL, 0, EX_NOWAIT);
421 EX_NOWAIT); 421 memext = extent_create("pexmem", memstart, memend, NULL, 0, EX_NOWAIT);
422 memext = extent_create("pexmem", memstart, memend, M_DEVBUF, NULL, 0, 
423 EX_NOWAIT); 
424 if (ioext != NULL && memext != NULL) 422 if (ioext != NULL && memext != NULL)
425 pci_configure_bus(pc, ioext, memext, NULL, 423 pci_configure_bus(pc, ioext, memext, NULL,
426 MVPEX_STAT_PEXBUSNUM(stat), cacheline_size); 424 MVPEX_STAT_PEXBUSNUM(stat), cacheline_size);
427 else 425 else
428 aprint_error_dev(sc->sc_dev, "can't create extent %s%s%s\n", 426 aprint_error_dev(sc->sc_dev, "can't create extent %s%s%s\n",
429 ioext == NULL ? "io" : "", 427 ioext == NULL ? "io" : "",
430 ioext == NULL && memext == NULL ? " and " : "", 428 ioext == NULL && memext == NULL ? " and " : "",
431 memext == NULL ? "mem" : ""); 429 memext == NULL ? "mem" : "");
432 if (ioext != NULL) 430 if (ioext != NULL)
433 extent_destroy(ioext); 431 extent_destroy(ioext);
434 if (memext != NULL) 432 if (memext != NULL)
435 extent_destroy(memext); 433 extent_destroy(memext);
436#endif 434#endif

cvs diff -r1.26 -r1.27 src/sys/dev/pci/btvmei.c (expand / switch to unified diff)

--- src/sys/dev/pci/btvmei.c 2009/11/26 15:17:08 1.26
+++ src/sys/dev/pci/btvmei.c 2012/01/27 18:53:08 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: btvmei.c,v 1.26 2009/11/26 15:17:08 njoly Exp $ */ 1/* $NetBSD: btvmei.c,v 1.27 2012/01/27 18:53:08 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 4 * Copyright (c) 1999
5 * Matthias Drochner. All rights reserved. 5 * Matthias Drochner. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * 28 *
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.26 2009/11/26 15:17:08 njoly Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.27 2012/01/27 18:53:08 para Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/kernel.h> 36#include <sys/kernel.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/proc.h> 38#include <sys/proc.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40 40
41#include <sys/bus.h> 41#include <sys/bus.h>
42#include <sys/extent.h> 42#include <sys/extent.h>
43 43
44#include <dev/pci/pcireg.h> 44#include <dev/pci/pcireg.h>
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
@@ -293,36 +293,36 @@ b3_617_init(struct b3_617_softc *sc) @@ -293,36 +293,36 @@ b3_617_init(struct b3_617_softc *sc)
293 293
294 /* all maps invalid */ 294 /* all maps invalid */
295 for (i = MR_PCI_VME; i < MR_PCI_VME + MR_PCI_VME_SIZE; i += 4) 295 for (i = MR_PCI_VME; i < MR_PCI_VME + MR_PCI_VME_SIZE; i += 4)
296 write_mapmem(sc, i, MR_RAM_INVALID); 296 write_mapmem(sc, i, MR_RAM_INVALID);
297 for (i = MR_VME_PCI; i < MR_VME_PCI + MR_VME_PCI_SIZE; i += 4) 297 for (i = MR_VME_PCI; i < MR_VME_PCI + MR_VME_PCI_SIZE; i += 4)
298 write_mapmem(sc, i, MR_RAM_INVALID); 298 write_mapmem(sc, i, MR_RAM_INVALID);
299 for (i = MR_DMA_PCI; i < MR_DMA_PCI + MR_DMA_PCI_SIZE; i += 4) 299 for (i = MR_DMA_PCI; i < MR_DMA_PCI + MR_DMA_PCI_SIZE; i += 4)
300 write_mapmem(sc, i, MR_RAM_INVALID); 300 write_mapmem(sc, i, MR_RAM_INVALID);
301 301
302 /* 302 /*
303 * set up scatter page allocation control 303 * set up scatter page allocation control
304 */ 304 */
305 sc->vmeext = extent_create("pcivme", MR_PCI_VME, 305 sc->vmeext = extent_create("pcivme", MR_PCI_VME,
306 MR_PCI_VME + MR_PCI_VME_SIZE - 1, M_DEVBUF, 306 MR_PCI_VME + MR_PCI_VME_SIZE - 1,
307 sc->vmemap, sizeof(sc->vmemap), 307 sc->vmemap, sizeof(sc->vmemap),
308 EX_NOCOALESCE); 308 EX_NOCOALESCE);
309#if 0 309#if 0
310 sc->pciext = extent_create("vmepci", MR_VME_PCI, 310 sc->pciext = extent_create("vmepci", MR_VME_PCI,
311 MR_VME_PCI + MR_VME_PCI_SIZE - 1, M_DEVBUF, 311 MR_VME_PCI + MR_VME_PCI_SIZE - 1,
312 sc->pcimap, sizeof(sc->pcimap), 312 sc->pcimap, sizeof(sc->pcimap),
313 EX_NOCOALESCE); 313 EX_NOCOALESCE);
314 sc->dmaext = extent_create("dmapci", MR_DMA_PCI, 314 sc->dmaext = extent_create("dmapci", MR_DMA_PCI,
315 MR_DMA_PCI + MR_DMA_PCI_SIZE - 1, M_DEVBUF, 315 MR_DMA_PCI + MR_DMA_PCI_SIZE - 1,
316 sc->dmamap, sizeof(sc->dmamap), 316 sc->dmamap, sizeof(sc->dmamap),
317 EX_NOCOALESCE); 317 EX_NOCOALESCE);
318#endif 318#endif
319 319
320 /* 320 /*
321 * init int handler queue, 321 * init int handler queue,
322 * enable interrupts if PCI interrupt available 322 * enable interrupts if PCI interrupt available
323 */ 323 */
324 TAILQ_INIT(&(sc->intrhdls)); 324 TAILQ_INIT(&(sc->intrhdls));
325 sc->strayintrs = 0; 325 sc->strayintrs = 0;
326 326
327 if (sc->sc_ih) 327 if (sc->sc_ih)
328 write_csr_byte(sc, LOC_INT_CTRL, LIC_INT_ENABLE); 328 write_csr_byte(sc, LOC_INT_CTRL, LIC_INT_ENABLE);

cvs diff -r1.33 -r1.34 src/sys/dev/pci/pciconf.c (expand / switch to unified diff)

--- src/sys/dev/pci/pciconf.c 2011/08/24 20:27:35 1.33
+++ src/sys/dev/pci/pciconf.c 2012/01/27 18:53:08 1.34
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pciconf.c,v 1.33 2011/08/24 20:27:35 dyoung Exp $ */ 1/* $NetBSD: pciconf.c,v 1.34 2012/01/27 18:53:08 para Exp $ */
2 2
3/* 3/*
4 * Copyright 2001 Wasabi Systems, Inc. 4 * Copyright 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Allen Briggs for Wasabi Systems, Inc. 7 * Written by Allen Briggs for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -55,27 +55,27 @@ @@ -55,27 +55,27 @@
55 * - Deal with "anything can be hot-plugged" -- i.e., carry configuration 55 * - Deal with "anything can be hot-plugged" -- i.e., carry configuration
56 * information around & be able to reconfigure on the fly 56 * information around & be able to reconfigure on the fly
57 * - Deal with segments (See IA64 System Abstraction Layer) 57 * - Deal with segments (See IA64 System Abstraction Layer)
58 * - Deal with subtractive bridges (& non-spec positive/subtractive decode) 58 * - Deal with subtractive bridges (& non-spec positive/subtractive decode)
59 * - Deal with ISA/VGA/VGA palette snooping 59 * - Deal with ISA/VGA/VGA palette snooping
60 * - Deal with device capabilities on bridges 60 * - Deal with device capabilities on bridges
61 * - Worry about changing a bridge to/from transparency 61 * - Worry about changing a bridge to/from transparency
62 * From thorpej (05/25/01) 62 * From thorpej (05/25/01)
63 * - Try to handle devices that are already configured (perhaps using that 63 * - Try to handle devices that are already configured (perhaps using that
64 * as a hint to where we put other devices) 64 * as a hint to where we put other devices)
65 */ 65 */
66 66
67#include <sys/cdefs.h> 67#include <sys/cdefs.h>
68__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.33 2011/08/24 20:27:35 dyoung Exp $"); 68__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.34 2012/01/27 18:53:08 para Exp $");
69 69
70#include "opt_pci.h" 70#include "opt_pci.h"
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/extent.h> 73#include <sys/extent.h>
74#include <sys/queue.h> 74#include <sys/queue.h>
75#include <sys/systm.h> 75#include <sys/systm.h>
76#include <sys/malloc.h> 76#include <sys/malloc.h>
77#include <sys/kmem.h> 77#include <sys/kmem.h>
78 78
79#include <dev/pci/pcivar.h> 79#include <dev/pci/pcivar.h>
80#include <dev/pci/pciconf.h> 80#include <dev/pci/pciconf.h>
81#include <dev/pci/pcidevs.h> 81#include <dev/pci/pcidevs.h>
@@ -698,27 +698,27 @@ setup_iowins(pciconf_bus_t *pb) @@ -698,27 +698,27 @@ setup_iowins(pciconf_bus_t *pb)
698 continue; 698 continue;
699 699
700 pd = pi->dev; 700 pd = pi->dev;
701 pi->address = pci_allocate_range(pb->ioext, pi->size, 701 pi->address = pci_allocate_range(pb->ioext, pi->size,
702 pi->align); 702 pi->align);
703 if (pi->address == -1) { 703 if (pi->address == -1) {
704 print_tag(pd->pc, pd->tag); 704 print_tag(pd->pc, pd->tag);
705 printf("Failed to allocate PCI I/O space (%" 705 printf("Failed to allocate PCI I/O space (%"
706 PRIu64 " req)\n", pi->size); 706 PRIu64 " req)\n", pi->size);
707 return -1; 707 return -1;
708 } 708 }
709 if (pd->ppb && pi->reg == 0) { 709 if (pd->ppb && pi->reg == 0) {
710 pd->ppb->ioext = extent_create("pciconf", pi->address, 710 pd->ppb->ioext = extent_create("pciconf", pi->address,
711 pi->address + pi->size, M_DEVBUF, NULL, 0, 711 pi->address + pi->size, NULL, 0,
712 EX_NOWAIT); 712 EX_NOWAIT);
713 if (pd->ppb->ioext == NULL) { 713 if (pd->ppb->ioext == NULL) {
714 print_tag(pd->pc, pd->tag); 714 print_tag(pd->pc, pd->tag);
715 printf("Failed to alloc I/O ext. for bus %d\n", 715 printf("Failed to alloc I/O ext. for bus %d\n",
716 pd->ppb->busno); 716 pd->ppb->busno);
717 return -1; 717 return -1;
718 } 718 }
719 continue; 719 continue;
720 } 720 }
721 if (!pb->io_32bit && pi->address > 0xFFFF) { 721 if (!pb->io_32bit && pi->address > 0xFFFF) {
722 pi->address = 0; 722 pi->address = 0;
723 pd->enable &= ~PCI_CONF_ENABLE_IO; 723 pd->enable &= ~PCI_CONF_ENABLE_IO;
724 } else { 724 } else {
@@ -749,28 +749,27 @@ setup_memwins(pciconf_bus_t *pb) @@ -749,28 +749,27 @@ setup_memwins(pciconf_bus_t *pb)
749 749
750 pd = pm->dev; 750 pd = pm->dev;
751 ex = (pm->prefetch) ? pb->pmemext : pb->memext; 751 ex = (pm->prefetch) ? pb->pmemext : pb->memext;
752 pm->address = pci_allocate_range(ex, pm->size, pm->align); 752 pm->address = pci_allocate_range(ex, pm->size, pm->align);
753 if (pm->address == -1) { 753 if (pm->address == -1) {
754 print_tag(pd->pc, pd->tag); 754 print_tag(pd->pc, pd->tag);
755 printf( 755 printf(
756 "Failed to allocate PCI memory space (%" PRIu64 756 "Failed to allocate PCI memory space (%" PRIu64
757 " req)\n", pm->size); 757 " req)\n", pm->size);
758 return -1; 758 return -1;
759 } 759 }
760 if (pd->ppb && pm->reg == 0) { 760 if (pd->ppb && pm->reg == 0) {
761 ex = extent_create("pciconf", pm->address, 761 ex = extent_create("pciconf", pm->address,
762 pm->address + pm->size, M_DEVBUF, NULL, 0, 762 pm->address + pm->size, NULL, 0, EX_NOWAIT);
763 EX_NOWAIT); 
764 if (ex == NULL) { 763 if (ex == NULL) {
765 print_tag(pd->pc, pd->tag); 764 print_tag(pd->pc, pd->tag);
766 printf("Failed to alloc MEM ext. for bus %d\n", 765 printf("Failed to alloc MEM ext. for bus %d\n",
767 pd->ppb->busno); 766 pd->ppb->busno);
768 return -1; 767 return -1;
769 } 768 }
770 if (pm->prefetch) { 769 if (pm->prefetch) {
771 pd->ppb->pmemext = ex; 770 pd->ppb->pmemext = ex;
772 } else { 771 } else {
773 pd->ppb->memext = ex; 772 pd->ppb->memext = ex;
774 } 773 }
775 continue; 774 continue;
776 } 775 }

cvs diff -r1.50 -r1.51 src/sys/dev/usb/usb_mem.c (expand / switch to unified diff)

--- src/sys/dev/usb/usb_mem.c 2011/09/27 01:02:38 1.50
+++ src/sys/dev/usb/usb_mem.c 2012/01/27 18:53:09 1.51
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: usb_mem.c,v 1.50 2011/09/27 01:02:38 jym Exp $ */ 1/* $NetBSD: usb_mem.c,v 1.51 2012/01/27 18:53:09 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at 8 * by Lennart Augustsson (lennart@augustsson.net) at
9 * Carlstedt Research & Technology. 9 * Carlstedt Research & Technology.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33/* 33/*
34 * USB DMA memory allocation. 34 * USB DMA memory allocation.
35 * We need to allocate a lot of small (many 8 byte, some larger) 35 * We need to allocate a lot of small (many 8 byte, some larger)
36 * memory blocks that can be used for DMA. Using the bus_dma 36 * memory blocks that can be used for DMA. Using the bus_dma
37 * routines directly would incur large overheads in space and time. 37 * routines directly would incur large overheads in space and time.
38 */ 38 */
39 39
40#include <sys/cdefs.h> 40#include <sys/cdefs.h>
41__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.50 2011/09/27 01:02:38 jym Exp $"); 41__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.51 2012/01/27 18:53:09 para Exp $");
42 42
43#ifdef _KERNEL_OPT 43#ifdef _KERNEL_OPT
44#include "opt_usb.h" 44#include "opt_usb.h"
45#endif 45#endif
46 46
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/malloc.h> 50#include <sys/malloc.h>
51#include <sys/queue.h> 51#include <sys/queue.h>
52#include <sys/device.h> /* for usbdivar.h */ 52#include <sys/device.h> /* for usbdivar.h */
53#include <sys/bus.h> 53#include <sys/bus.h>
54#include <sys/cpu.h> 54#include <sys/cpu.h>
@@ -422,28 +422,27 @@ usb_setup_reserve(device_t dv, struct us @@ -422,28 +422,27 @@ usb_setup_reserve(device_t dv, struct us
422 422
423 error = bus_dmamap_create(dtag, USB_MEM_RESERVE, 1, 423 error = bus_dmamap_create(dtag, USB_MEM_RESERVE, 1,
424 USB_MEM_RESERVE, 0, BUS_DMA_NOWAIT, &rs->map); 424 USB_MEM_RESERVE, 0, BUS_DMA_NOWAIT, &rs->map);
425 if (error != 0) 425 if (error != 0)
426 goto unmap; 426 goto unmap;
427 427
428 error = bus_dmamap_load(dtag, rs->map, rs->vaddr, USB_MEM_RESERVE, 428 error = bus_dmamap_load(dtag, rs->map, rs->vaddr, USB_MEM_RESERVE,
429 NULL, BUS_DMA_NOWAIT); 429 NULL, BUS_DMA_NOWAIT);
430 if (error != 0) 430 if (error != 0)
431 goto destroy; 431 goto destroy;
432 432
433 rs->paddr = rs->map->dm_segs[0].ds_addr; 433 rs->paddr = rs->map->dm_segs[0].ds_addr;
434 rs->extent = extent_create(device_xname(dv), (u_long)rs->paddr, 434 rs->extent = extent_create(device_xname(dv), (u_long)rs->paddr,
435 (u_long)(rs->paddr + USB_MEM_RESERVE - 1), 435 (u_long)(rs->paddr + USB_MEM_RESERVE - 1), 0, 0, 0);
436 M_USB, 0, 0, 0); 
437 if (rs->extent == NULL) { 436 if (rs->extent == NULL) {
438 rs->vaddr = 0; 437 rs->vaddr = 0;
439 return ENOMEM; 438 return ENOMEM;
440 } 439 }
441 440
442 return 0; 441 return 0;
443 442
444 destroy: 443 destroy:
445 bus_dmamap_destroy(dtag, rs->map); 444 bus_dmamap_destroy(dtag, rs->map);
446 unmap: 445 unmap:
447 bus_dmamem_unmap(dtag, rs->vaddr, size); 446 bus_dmamem_unmap(dtag, rs->vaddr, size);
448 freeit: 447 freeit:
449 bus_dmamem_free(dtag, &seg, nseg); 448 bus_dmamem_free(dtag, &seg, nseg);

cvs diff -r1.24 -r1.25 src/sys/dev/vme/vme.c (expand / switch to unified diff)

--- src/sys/dev/vme/vme.c 2010/12/11 18:12:45 1.24
+++ src/sys/dev/vme/vme.c 2012/01/27 18:53:09 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vme.c,v 1.24 2010/12/11 18:12:45 matt Exp $ */ 1/* $NetBSD: vme.c,v 1.25 2012/01/27 18:53:09 para Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999 4 * Copyright (c) 1999
5 * Matthias Drochner. All rights reserved. 5 * Matthias Drochner. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 * 28 *
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.24 2010/12/11 18:12:45 matt Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.25 2012/01/27 18:53:09 para Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/malloc.h> 37#include <sys/malloc.h>
38#include <sys/extent.h> 38#include <sys/extent.h>
39#include <sys/bus.h> 39#include <sys/bus.h>
40 40
41#include <dev/vme/vmereg.h> 41#include <dev/vme/vmereg.h>
42#include <dev/vme/vmevar.h> 42#include <dev/vme/vmevar.h>
43 43
44static void vme_extractlocators(int*, struct vme_attach_args*); 44static void vme_extractlocators(int*, struct vme_attach_args*);
45static int vmeprint(struct vme_attach_args*, char*); 45static int vmeprint(struct vme_attach_args*, char*);
@@ -177,42 +177,39 @@ vmeattach(device_t parent, device_t self @@ -177,42 +177,39 @@ vmeattach(device_t parent, device_t self
177 sc->sc_vct = aa->va_vct; 177 sc->sc_vct = aa->va_vct;
178 sc->sc_bdt = aa->va_bdt; 178 sc->sc_bdt = aa->va_bdt;
179 179
180 /* the "bus" are we ourselves */ 180 /* the "bus" are we ourselves */
181 sc->sc_vct->bus = sc; 181 sc->sc_vct->bus = sc;
182 182
183 sc->slaveconfig = aa->va_slaveconfig; 183 sc->slaveconfig = aa->va_slaveconfig;
184 184
185 printf("\n"); 185 printf("\n");
186 186
187 /* 187 /*
188 * set up address space accounting - assume incomplete decoding 188 * set up address space accounting - assume incomplete decoding
189 */ 189 */
190 sc->vme32ext = extent_create("vme32", 0, 0xffffffff, 190 sc->vme32ext = extent_create("vme32", 0, 0xffffffff, 0, 0, 0);
191 M_DEVBUF, 0, 0, 0); 
192 if (!sc->vme32ext) { 191 if (!sc->vme32ext) {
193 printf("error creating A32 map\n"); 192 printf("error creating A32 map\n");
194 return; 193 return;
195 } 194 }
196 195
197 sc->vme24ext = extent_create("vme24", 0, 0x00ffffff, 196 sc->vme24ext = extent_create("vme24", 0, 0x00ffffff, 0, 0, 0);
198 M_DEVBUF, 0, 0, 0); 
199 if (!sc->vme24ext) { 197 if (!sc->vme24ext) {
200 printf("error creating A24 map\n"); 198 printf("error creating A24 map\n");
201 return; 199 return;
202 } 200 }
203 201
204 sc->vme16ext = extent_create("vme16", 0, 0x0000ffff, 202 sc->vme16ext = extent_create("vme16", 0, 0x0000ffff, 0, 0, 0);
205 M_DEVBUF, 0, 0, 0); 
206 if (!sc->vme16ext) { 203 if (!sc->vme16ext) {
207 printf("error creating A16 map\n"); 204 printf("error creating A16 map\n");
208 return; 205 return;
209 } 206 }
210 207
211 if (sc->slaveconfig) { 208 if (sc->slaveconfig) {
212 /* first get info about the bus master's slave side, 209 /* first get info about the bus master's slave side,
213 if present */ 210 if present */
214 config_search_ia(vmesubmatch1, self, "vme", 0); 211 config_search_ia(vmesubmatch1, self, "vme", 0);
215 } 212 }
216 config_search_ia(vmesubmatch, self, "vme", 0); 213 config_search_ia(vmesubmatch, self, "vme", 0);
217 214
218#ifdef VMEDEBUG 215#ifdef VMEDEBUG

cvs diff -r1.72 -r1.73 src/sys/kern/subr_extent.c (expand / switch to unified diff)

--- src/sys/kern/subr_extent.c 2008/04/28 20:24:04 1.72
+++ src/sys/kern/subr_extent.c 2012/01/27 18:53:09 1.73
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: subr_extent.c,v 1.72 2008/04/28 20:24:04 martin Exp $ */ 1/* $NetBSD: subr_extent.c,v 1.73 2012/01/27 18:53:09 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1998, 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1998, 2007 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe and Matthias Drochner. 8 * by Jason R. Thorpe and Matthias Drochner.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,34 +24,34 @@ @@ -24,34 +24,34 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * General purpose extent manager. 33 * General purpose extent manager.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.72 2008/04/28 20:24:04 martin Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.73 2012/01/27 18:53:09 para Exp $");
38 38
39#ifdef _KERNEL 39#ifdef _KERNEL
40#include "opt_lockdebug.h" 40#include "opt_lockdebug.h"
41 41
42#include <sys/param.h> 42#include <sys/param.h>
43#include <sys/extent.h> 43#include <sys/extent.h>
44#include <sys/malloc.h> 44#include <sys/kmem.h>
45#include <sys/pool.h> 45#include <sys/pool.h>
46#include <sys/time.h> 46#include <sys/time.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
49 49
50#include <uvm/uvm_extern.h> 50#include <uvm/uvm_extern.h>
51 51
52#define KMEM_IS_RUNNING (kmem_map != NULL) 52#define KMEM_IS_RUNNING (kmem_map != NULL)
53#elif defined(_EXTENT_TESTING) 53#elif defined(_EXTENT_TESTING)
54/* 54/*
55 * user-land definitions, so it can fit into a testing harness. 55 * user-land definitions, so it can fit into a testing harness.
56 */ 56 */
57#include <sys/param.h> 57#include <sys/param.h>
@@ -59,35 +59,35 @@ __KERNEL_RCSID(0, "$NetBSD: subr_extent. @@ -59,35 +59,35 @@ __KERNEL_RCSID(0, "$NetBSD: subr_extent.
59#include <sys/extent.h> 59#include <sys/extent.h>
60 60
61#include <errno.h> 61#include <errno.h>
62#include <stdlib.h> 62#include <stdlib.h>
63#include <stdio.h> 63#include <stdio.h>
64#include <string.h> 64#include <string.h>
65 65
66/* 66/*
67 * Use multi-line #defines to avoid screwing up the kernel tags file; 67 * Use multi-line #defines to avoid screwing up the kernel tags file;
68 * without this, ctags produces a tags file where panic() shows up 68 * without this, ctags produces a tags file where panic() shows up
69 * in subr_extent.c rather than subr_prf.c. 69 * in subr_extent.c rather than subr_prf.c.
70 */ 70 */
71#define \ 71#define \
72malloc(s, t, flags) malloc(s) 72kmem_alloc(s, flags) malloc(s)
73#define \ 73#define \
74free(p, t) free(p) 74kmem_free(p, s) free(p)
75#define \ 75#define \
76cv_wait_sig(cv, lock) (EWOULDBLOCK) 76cv_wait_sig(cv, lock) (EWOULDBLOCK)
77#define \ 77#define \
78pool_get(pool, flags) malloc((pool)->pr_size,0,0) 78pool_get(pool, flags) kmem_alloc((pool)->pr_size,0)
79#define \ 79#define \
80pool_put(pool, rp) free(rp,0) 80pool_put(pool, rp) kmem_free(rp,0)
81#define \ 81#define \
82panic(a) printf(a) 82panic(a) printf(a)
83#define mutex_init(a, b, c) 83#define mutex_init(a, b, c)
84#define mutex_destroy(a) 84#define mutex_destroy(a)
85#define mutex_enter(l) 85#define mutex_enter(l)
86#define mutex_exit(l) 86#define mutex_exit(l)
87#define cv_wait(cv, lock) 87#define cv_wait(cv, lock)
88#define cv_broadcast(cv) 88#define cv_broadcast(cv)
89#define cv_init(a, b) 89#define cv_init(a, b)
90#define cv_destroy(a) 90#define cv_destroy(a)
91#define KMEM_IS_RUNNING (1) 91#define KMEM_IS_RUNNING (1)
92#define IPL_VM (0) 92#define IPL_VM (0)
93#define MUTEX_DEFAULT (0) 93#define MUTEX_DEFAULT (0)
@@ -225,27 +225,27 @@ extent_free_region_descriptor(struct ext @@ -225,27 +225,27 @@ extent_free_region_descriptor(struct ext
225 } 225 }
226 226
227 /* 227 /*
228 * We know it's dynamically allocated if we get here. 228 * We know it's dynamically allocated if we get here.
229 */ 229 */
230 pool_put(&expool, rp); 230 pool_put(&expool, rp);
231} 231}
232 232
233/* 233/*
234 * Allocate and initialize an extent map. 234 * Allocate and initialize an extent map.
235 */ 235 */
236struct extent * 236struct extent *
237extent_create(const char *name, u_long start, u_long end, 237extent_create(const char *name, u_long start, u_long end,
238 struct malloc_type *mtype, void *storage, size_t storagesize, int flags) 238 void *storage, size_t storagesize, int flags)
239{ 239{
240 struct extent *ex; 240 struct extent *ex;
241 char *cp = storage; 241 char *cp = storage;
242 size_t sz = storagesize; 242 size_t sz = storagesize;
243 struct extent_region *rp; 243 struct extent_region *rp;
244 int fixed_extent = (storage != NULL); 244 int fixed_extent = (storage != NULL);
245 245
246#ifndef _KERNEL 246#ifndef _KERNEL
247 extent_init(); 247 extent_init();
248#endif 248#endif
249 249
250#ifdef DIAGNOSTIC 250#ifdef DIAGNOSTIC
251 /* Check arguments. */ 251 /* Check arguments. */
@@ -281,40 +281,39 @@ extent_create(const char *name, u_long s @@ -281,40 +281,39 @@ extent_create(const char *name, u_long s
281 281
282 /* 282 /*
283 * In a fixed extent, we have to pre-allocate region 283 * In a fixed extent, we have to pre-allocate region
284 * descriptors and place them in the extent's freelist. 284 * descriptors and place them in the extent's freelist.
285 */ 285 */
286 LIST_INIT(&fex->fex_freelist); 286 LIST_INIT(&fex->fex_freelist);
287 while (sz >= ALIGN(sizeof(struct extent_region))) { 287 while (sz >= ALIGN(sizeof(struct extent_region))) {
288 rp = (struct extent_region *)cp; 288 rp = (struct extent_region *)cp;
289 cp += ALIGN(sizeof(struct extent_region)); 289 cp += ALIGN(sizeof(struct extent_region));
290 sz -= ALIGN(sizeof(struct extent_region)); 290 sz -= ALIGN(sizeof(struct extent_region));
291 LIST_INSERT_HEAD(&fex->fex_freelist, rp, er_link); 291 LIST_INSERT_HEAD(&fex->fex_freelist, rp, er_link);
292 } 292 }
293 } else { 293 } else {
294 ex = (struct extent *)malloc(sizeof(struct extent), 294 ex = (struct extent *)kmem_alloc(sizeof(struct extent),
295 mtype, (flags & EX_WAITOK) ? M_WAITOK : M_NOWAIT); 295 (flags & EX_WAITOK) ? KM_SLEEP : KM_NOSLEEP);
296 if (ex == NULL) 296 if (ex == NULL)
297 return (NULL); 297 return (NULL);
298 } 298 }
299 299
300 /* Fill in the extent descriptor and return it to the caller. */ 300 /* Fill in the extent descriptor and return it to the caller. */
301 mutex_init(&ex->ex_lock, MUTEX_DEFAULT, IPL_VM); 301 mutex_init(&ex->ex_lock, MUTEX_DEFAULT, IPL_VM);
302 cv_init(&ex->ex_cv, "extent"); 302 cv_init(&ex->ex_cv, "extent");
303 LIST_INIT(&ex->ex_regions); 303 LIST_INIT(&ex->ex_regions);
304 ex->ex_name = name; 304 ex->ex_name = name;
305 ex->ex_start = start; 305 ex->ex_start = start;
306 ex->ex_end = end; 306 ex->ex_end = end;
307 ex->ex_mtype = mtype; 
308 ex->ex_flags = 0; 307 ex->ex_flags = 0;
309 if (fixed_extent) 308 if (fixed_extent)
310 ex->ex_flags |= EXF_FIXED; 309 ex->ex_flags |= EXF_FIXED;
311 if (flags & EX_NOCOALESCE) 310 if (flags & EX_NOCOALESCE)
312 ex->ex_flags |= EXF_NOCOALESCE; 311 ex->ex_flags |= EXF_NOCOALESCE;
313 return (ex); 312 return (ex);
314} 313}
315 314
316/* 315/*
317 * Destroy an extent map. 316 * Destroy an extent map.
318 * Since we're freeing the data, there can't be any references 317 * Since we're freeing the data, there can't be any references
319 * so we don't need any locking. 318 * so we don't need any locking.
320 */ 319 */
@@ -332,27 +331,27 @@ extent_destroy(struct extent *ex) @@ -332,27 +331,27 @@ extent_destroy(struct extent *ex)
332 /* Free all region descriptors in extent. */ 331 /* Free all region descriptors in extent. */
333 for (rp = LIST_FIRST(&ex->ex_regions); rp != NULL; ) { 332 for (rp = LIST_FIRST(&ex->ex_regions); rp != NULL; ) {
334 orp = rp; 333 orp = rp;
335 rp = LIST_NEXT(rp, er_link); 334 rp = LIST_NEXT(rp, er_link);
336 LIST_REMOVE(orp, er_link); 335 LIST_REMOVE(orp, er_link);
337 extent_free_region_descriptor(ex, orp); 336 extent_free_region_descriptor(ex, orp);
338 } 337 }
339 338
340 cv_destroy(&ex->ex_cv); 339 cv_destroy(&ex->ex_cv);
341 mutex_destroy(&ex->ex_lock); 340 mutex_destroy(&ex->ex_lock);
342 341
343 /* If we're not a fixed extent, free the extent descriptor itself. */ 342 /* If we're not a fixed extent, free the extent descriptor itself. */
344 if ((ex->ex_flags & EXF_FIXED) == 0) 343 if ((ex->ex_flags & EXF_FIXED) == 0)
345 free(ex, ex->ex_mtype); 344 kmem_free(ex, sizeof(*ex));
346} 345}
347 346
348/* 347/*
349 * Insert a region descriptor into the sorted region list after the 348 * Insert a region descriptor into the sorted region list after the
350 * entry "after" or at the head of the list (if "after" is NULL). 349 * entry "after" or at the head of the list (if "after" is NULL).
351 * The region descriptor we insert is passed in "rp". We must 350 * The region descriptor we insert is passed in "rp". We must
352 * allocate the region descriptor before calling this function! 351 * allocate the region descriptor before calling this function!
353 * If we don't need the region descriptor, it will be freed here. 352 * If we don't need the region descriptor, it will be freed here.
354 */ 353 */
355static void 354static void
356extent_insert_and_optimize(struct extent *ex, u_long start, u_long size, 355extent_insert_and_optimize(struct extent *ex, u_long start, u_long size,
357 int flags, struct extent_region *after, struct extent_region *rp) 356 int flags, struct extent_region *after, struct extent_region *rp)
358{ 357{

cvs diff -r1.18 -r1.19 src/sys/sys/extent.h (expand / switch to unified diff)

--- src/sys/sys/extent.h 2008/04/28 20:24:10 1.18
+++ src/sys/sys/extent.h 2012/01/27 18:53:10 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: extent.h,v 1.18 2008/04/28 20:24:10 martin Exp $ */ 1/* $NetBSD: extent.h,v 1.19 2012/01/27 18:53:10 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -44,72 +44,69 @@ struct extent_region { @@ -44,72 +44,69 @@ struct extent_region {
44}; 44};
45 45
46/* er_flags */ 46/* er_flags */
47#define ER_ALLOC 0x01 /* region descriptor dynamically allocated */ 47#define ER_ALLOC 0x01 /* region descriptor dynamically allocated */
48 48
49struct extent { 49struct extent {
50 const char *ex_name; /* name of extent */ 50 const char *ex_name; /* name of extent */
51 kmutex_t ex_lock; /* lock on this extent */ 51 kmutex_t ex_lock; /* lock on this extent */
52 kcondvar_t ex_cv; /* synchronization */ 52 kcondvar_t ex_cv; /* synchronization */
53 /* allocated regions in extent */ 53 /* allocated regions in extent */
54 LIST_HEAD(, extent_region) ex_regions; 54 LIST_HEAD(, extent_region) ex_regions;
55 u_long ex_start; /* start of extent */ 55 u_long ex_start; /* start of extent */
56 u_long ex_end; /* end of extent */ 56 u_long ex_end; /* end of extent */
57 struct malloc_type *ex_mtype; /* memory type */ 
58 int ex_flags; /* misc. information */ 57 int ex_flags; /* misc. information */
59}; 58};
60 59
61struct extent_fixed { 60struct extent_fixed {
62 struct extent fex_extent; /* MUST BE FIRST */ 61 struct extent fex_extent; /* MUST BE FIRST */
63 /* freelist of region descriptors */ 62 /* freelist of region descriptors */
64 LIST_HEAD(, extent_region) fex_freelist; 63 LIST_HEAD(, extent_region) fex_freelist;
65 void * fex_storage; /* storage space for descriptors */ 64 void * fex_storage; /* storage space for descriptors */
66 size_t fex_storagesize; /* size of storage space */ 65 size_t fex_storagesize; /* size of storage space */
67}; 66};
68 67
69/* ex_flags; for internal use only */ 68/* ex_flags; for internal use only */
70#define EXF_FIXED 0x01 /* extent uses fixed storage */ 69#define EXF_FIXED 0x01 /* extent uses fixed storage */
71#define EXF_NOCOALESCE 0x02 /* coalescing of regions not allowed */ 70#define EXF_NOCOALESCE 0x02 /* coalescing of regions not allowed */
72#define EXF_FLWANTED 0x08 /* someone asleep on freelist */ 71#define EXF_FLWANTED 0x08 /* someone asleep on freelist */
73 72
74#define EXF_BITS "\20\4FLWANTED\2NOCOALESCE\1FIXED" 73#define EXF_BITS "\20\4FLWANTED\2NOCOALESCE\1FIXED"
75 74
76/* misc. flags passed to extent functions */ 75/* misc. flags passed to extent functions */
77#define EX_NOWAIT 0x00 /* not safe to sleep */ 76#define EX_NOWAIT 0x00 /* not safe to sleep */
78#define EX_WAITOK 0x01 /* safe to sleep */ 77#define EX_WAITOK 0x01 /* safe to sleep */
79#define EX_FAST 0x02 /* take first fit in extent_alloc() */ 78#define EX_FAST 0x02 /* take first fit in extent_alloc() */
80#define EX_CATCH 0x04 /* catch signals while sleeping */ 79#define EX_CATCH 0x04 /* catch signals while sleeping */
81#define EX_NOCOALESCE 0x08 /* create a non-coalescing extent */ 80#define EX_NOCOALESCE 0x08 /* create a non-coalescing extent */
82#define EX_MALLOCOK 0x10 /* safe to call malloc() */ 81#define EX_MALLOCOK 0x10 /* safe to call kmem_alloc() */
83#define EX_WAITSPACE 0x20 /* wait for space to become free */ 82#define EX_WAITSPACE 0x20 /* wait for space to become free */
84#define EX_BOUNDZERO 0x40 /* boundary lines start at 0 */ 83#define EX_BOUNDZERO 0x40 /* boundary lines start at 0 */
85 84
86/* 85/*
87 * Special place holders for "alignment" and "boundary" arguments, 86 * Special place holders for "alignment" and "boundary" arguments,
88 * in the event the caller doesn't wish to use those features. 87 * in the event the caller doesn't wish to use those features.
89 */ 88 */
90#define EX_NOALIGN 1 /* don't do alignment */ 89#define EX_NOALIGN 1 /* don't do alignment */
91#define EX_NOBOUNDARY 0 /* don't do boundary checking */ 90#define EX_NOBOUNDARY 0 /* don't do boundary checking */
92 91
93#if defined(_KERNEL) || defined(_EXTENT_TESTING) 92#if defined(_KERNEL) || defined(_EXTENT_TESTING)
94#define EXTENT_FIXED_STORAGE_SIZE(_nregions) \ 93#define EXTENT_FIXED_STORAGE_SIZE(_nregions) \
95 (ALIGN(sizeof(struct extent_fixed)) + \ 94 (ALIGN(sizeof(struct extent_fixed)) + \
96 ((ALIGN(sizeof(struct extent_region))) * \ 95 ((ALIGN(sizeof(struct extent_region))) * \
97 (_nregions))) 96 (_nregions)))
98 97
99struct malloc_type; 
100 
101struct extent *extent_create(const char *, u_long, u_long, 98struct extent *extent_create(const char *, u_long, u_long,
102 struct malloc_type *, void *, size_t, int); 99 void *, size_t, int);
103void extent_destroy(struct extent *); 100void extent_destroy(struct extent *);
104int extent_alloc_subregion1(struct extent *, u_long, u_long, 101int extent_alloc_subregion1(struct extent *, u_long, u_long,
105 u_long, u_long, u_long, u_long, int, u_long *); 102 u_long, u_long, u_long, u_long, int, u_long *);
106int extent_alloc_subregion(struct extent *, u_long, u_long, 103int extent_alloc_subregion(struct extent *, u_long, u_long,
107 u_long, u_long, u_long, int, u_long *); 104 u_long, u_long, u_long, int, u_long *);
108int extent_alloc_region(struct extent *, u_long, u_long, int); 105int extent_alloc_region(struct extent *, u_long, u_long, int);
109int extent_alloc1(struct extent *, u_long, u_long, u_long, u_long, int, 106int extent_alloc1(struct extent *, u_long, u_long, u_long, u_long, int,
110 u_long *); 107 u_long *);
111int extent_alloc(struct extent *, u_long, u_long, u_long, int, u_long *); 108int extent_alloc(struct extent *, u_long, u_long, u_long, int, u_long *);
112int extent_free(struct extent *, u_long, u_long, int); 109int extent_free(struct extent *, u_long, u_long, int);
113void extent_print(struct extent *); 110void extent_print(struct extent *);
114void extent_init(void); 111void extent_init(void);
115 112

cvs diff -r1.3 -r1.4 src/tests/kernel/t_extent.c (expand / switch to unified diff)

--- src/tests/kernel/t_extent.c 2011/06/11 18:03:17 1.3
+++ src/tests/kernel/t_extent.c 2012/01/27 18:53:10 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: t_extent.c,v 1.3 2011/06/11 18:03:17 christos Exp $ */ 1/* $NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -19,46 +19,46 @@ @@ -19,46 +19,46 @@
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__COPYRIGHT("@(#) Copyright (c) 2008\ 30__COPYRIGHT("@(#) Copyright (c) 2008\
31 The NetBSD Foundation, inc. All rights reserved."); 31 The NetBSD Foundation, inc. All rights reserved.");
32__RCSID("$NetBSD: t_extent.c,v 1.3 2011/06/11 18:03:17 christos Exp $"); 32__RCSID("$NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $");
33 33
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/queue.h> 35#include <sys/queue.h>
36#include <sys/extent.h> 36#include <sys/extent.h>
37 37
38#include <stdio.h> 38#include <stdio.h>
39#include <stdlib.h> 39#include <stdlib.h>
40#include <string.h> 40#include <string.h>
41 41
42#include <atf-c.h> 42#include <atf-c.h>
43 43
44#include "../h_macros.h" 44#include "../h_macros.h"
45 45
46static int ret; 46static int ret;
47static struct extent *ex; 47static struct extent *ex;
48 48
49#define h_create(name, start, end, flags) \ 49#define h_create(name, start, end, flags) \
50 ATF_REQUIRE((ex = extent_create(name, \ 50 ATF_REQUIRE((ex = extent_create(name, \
51 start, end, 0, 0, 0, flags)) != NULL); 51 start, end, 0, 0, flags)) != NULL);
52 52
53#define h_alloc_region(start, size) \ 53#define h_alloc_region(start, size) \
54 ATF_REQUIRE_EQ_MSG(ret = extent_alloc_region(ex, \ 54 ATF_REQUIRE_EQ_MSG(ret = extent_alloc_region(ex, \
55 start, size, 0), 0, "%s", strerror(ret)); 55 start, size, 0), 0, "%s", strerror(ret));
56 56
57#define h_free(start, size) \ 57#define h_free(start, size) \
58 ATF_REQUIRE_EQ_MSG(ret = extent_free(ex, \ 58 ATF_REQUIRE_EQ_MSG(ret = extent_free(ex, \
59 start, size, 0), 0, "%s", strerror(ret)); 59 start, size, 0), 0, "%s", strerror(ret));
60 60
61static void 61static void
62h_alloc_subregion(u_long substart, u_long subend, u_long size, 62h_alloc_subregion(u_long substart, u_long subend, u_long size,
63 u_long alignment, u_long boundary, int expret, u_long expres) 63 u_long alignment, u_long boundary, int expret, u_long expres)
64{ 64{