| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: bus_space.c,v 1.31 2010/07/27 13:54:19 jakllsch Exp $ */ | | 1 | /* $NetBSD: bus_space.c,v 1.32 2011/01/10 16:59:09 jruoho 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.31 2010/07/27 13:54:19 jakllsch Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.32 2011/01/10 16:59:09 jruoho 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 <dev/isa/isareg.h> | | 43 | #include <dev/isa/isareg.h> |
44 | | | 44 | |
45 | #include <sys/bus.h> | | 45 | #include <sys/bus.h> |
46 | #include <machine/pio.h> | | 46 | #include <machine/pio.h> |
47 | #include <machine/isa_machdep.h> | | 47 | #include <machine/isa_machdep.h> |
| @@ -75,27 +75,27 @@ __KERNEL_RCSID(0, "$NetBSD: bus_space.c, | | | @@ -75,27 +75,27 @@ __KERNEL_RCSID(0, "$NetBSD: bus_space.c, |
75 | /* | | 75 | /* |
76 | * Extent maps to manage I/O and memory space. Allocate | | 76 | * Extent maps to manage I/O and memory space. Allocate |
77 | * storage for 8 regions in each, initially. Later, ioport_malloc_safe | | 77 | * storage for 8 regions in each, initially. Later, ioport_malloc_safe |
78 | * will indicate that it's safe to use malloc() to dynamically allocate | | 78 | * will indicate that it's safe to use malloc() to dynamically allocate |
79 | * region descriptors. | | 79 | * region descriptors. |
80 | * | | 80 | * |
81 | * N.B. At least two regions are _always_ allocated from the iomem | | 81 | * N.B. At least two regions are _always_ allocated from the iomem |
82 | * extent map; (0 -> ISA hole) and (end of ISA hole -> end of RAM). | | 82 | * extent map; (0 -> ISA hole) and (end of ISA hole -> end of RAM). |
83 | * | | 83 | * |
84 | * The extent maps are not static! Machine-dependent ISA and EISA | | 84 | * The extent maps are not static! Machine-dependent ISA and EISA |
85 | * routines need access to them for bus address space allocation. | | 85 | * routines need access to them for bus address space allocation. |
86 | */ | | 86 | */ |
87 | static long ioport_ex_storage[EXTENT_FIXED_STORAGE_SIZE(16) / sizeof(long)]; | | 87 | static long ioport_ex_storage[EXTENT_FIXED_STORAGE_SIZE(16) / sizeof(long)]; |
88 | static long iomem_ex_storage[EXTENT_FIXED_STORAGE_SIZE(16) / sizeof(long)]; | | 88 | static long iomem_ex_storage[EXTENT_FIXED_STORAGE_SIZE(64) / sizeof(long)]; |
89 | struct extent *ioport_ex; | | 89 | struct extent *ioport_ex; |
90 | struct extent *iomem_ex; | | 90 | struct extent *iomem_ex; |
91 | static int ioport_malloc_safe; | | 91 | static int ioport_malloc_safe; |
92 | | | 92 | |
93 | static struct bus_space_tag x86_io = { .bst_type = X86_BUS_SPACE_IO }; | | 93 | static struct bus_space_tag x86_io = { .bst_type = X86_BUS_SPACE_IO }; |
94 | static struct bus_space_tag x86_mem = { .bst_type = X86_BUS_SPACE_MEM }; | | 94 | static struct bus_space_tag x86_mem = { .bst_type = X86_BUS_SPACE_MEM }; |
95 | | | 95 | |
96 | bus_space_tag_t x86_bus_space_io = &x86_io; | | 96 | bus_space_tag_t x86_bus_space_io = &x86_io; |
97 | bus_space_tag_t x86_bus_space_mem = &x86_mem; | | 97 | bus_space_tag_t x86_bus_space_mem = &x86_mem; |
98 | | | 98 | |
99 | int x86_mem_add_mapping(bus_addr_t, bus_size_t, | | 99 | int x86_mem_add_mapping(bus_addr_t, bus_size_t, |
100 | int, bus_space_handle_t *); | | 100 | int, bus_space_handle_t *); |
101 | | | 101 | |