Pull up following revision(s) (requested by skrll in ticket #1035): sys/arch/hp700/dev/dino.c: revision 1.14 via patch sys/arch/hp700/hp700/mainbus.c: revision 1.53 sys/arch/hp700/include/bus.h: revision 1.14 Provide bus_space_mmap. Still needs implementing.diff -r1.6 -r1.6.4.1 src/sys/arch/hp700/dev/dino.c
(snj)
--- src/sys/arch/hp700/dev/Attic/dino.c 2008/08/28 08:25:46 1.6
+++ src/sys/arch/hp700/dev/Attic/dino.c 2009/09/29 22:56:48 1.6.4.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: dino.c,v 1.6 2008/08/28 08:25:46 skrll Exp $ */ | 1 | /* $NetBSD: dino.c,v 1.6.4.1 2009/09/29 22:56:48 snj 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.6 2008/08/28 08:25:46 skrll Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.6.4.1 2009/09/29 22:56:48 snj 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> | |
@@ -150,26 +150,28 @@ void dino_intr_disestablish(void *, void | @@ -150,26 +150,28 @@ void dino_intr_disestablish(void *, void | |||
150 | void *dino_alloc_parent(struct device *, struct pci_attach_args *, int); | 150 | void *dino_alloc_parent(struct device *, struct pci_attach_args *, int); | |
151 | int dino_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 151 | int dino_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
152 | int dino_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 152 | int dino_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
153 | int dino_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, | 153 | int dino_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, | |
154 | bus_space_handle_t *); | 154 | bus_space_handle_t *); | |
155 | int dino_ioalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, | 155 | int dino_ioalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, | |
156 | bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | 156 | bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | |
157 | int dino_memalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, | 157 | int dino_memalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, | |
158 | bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | 158 | bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | |
159 | void dino_unmap(void *, bus_space_handle_t, bus_size_t); | 159 | void dino_unmap(void *, bus_space_handle_t, bus_size_t); | |
160 | void dino_free(void *, bus_space_handle_t, bus_size_t); | 160 | void dino_free(void *, bus_space_handle_t, bus_size_t); | |
161 | void dino_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | 161 | void dino_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | |
162 | void *dino_vaddr(void *, bus_space_handle_t); | 162 | void *dino_vaddr(void *, bus_space_handle_t); | |
163 | paddr_t dino_mmap(void *, bus_addr_t, off_t, int, int); | |||
164 | ||||
163 | u_int8_t dino_r1(void *, bus_space_handle_t, bus_size_t); | 165 | u_int8_t dino_r1(void *, bus_space_handle_t, bus_size_t); | |
164 | u_int16_t dino_r2(void *, bus_space_handle_t, bus_size_t); | 166 | u_int16_t dino_r2(void *, bus_space_handle_t, bus_size_t); | |
165 | u_int32_t dino_r4(void *, bus_space_handle_t, bus_size_t); | 167 | u_int32_t dino_r4(void *, bus_space_handle_t, bus_size_t); | |
166 | u_int64_t dino_r8(void *, bus_space_handle_t, bus_size_t); | 168 | u_int64_t dino_r8(void *, bus_space_handle_t, bus_size_t); | |
167 | void dino_w1(void *, bus_space_handle_t, bus_size_t, u_int8_t); | 169 | void dino_w1(void *, bus_space_handle_t, bus_size_t, u_int8_t); | |
168 | void dino_w2(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 170 | void dino_w2(void *, bus_space_handle_t, bus_size_t, u_int16_t); | |
169 | void dino_w4(void *, bus_space_handle_t, bus_size_t, u_int32_t); | 171 | void dino_w4(void *, bus_space_handle_t, bus_size_t, u_int32_t); | |
170 | void dino_w8(void *, bus_space_handle_t, bus_size_t, u_int64_t); | 172 | void dino_w8(void *, bus_space_handle_t, bus_size_t, u_int64_t); | |
171 | void dino_rm_1(void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); | 173 | void dino_rm_1(void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); | |
172 | void dino_rm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t); | 174 | void dino_rm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t); | |
173 | void dino_rm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t); | 175 | void dino_rm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t); | |
174 | void dino_rm_8(void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); | 176 | void dino_rm_8(void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); | |
175 | void dino_wm_1(void *, bus_space_handle_t, bus_size_t, const u_int8_t *, | 177 | void dino_wm_1(void *, bus_space_handle_t, bus_size_t, const u_int8_t *, | |
@@ -558,26 +560,32 @@ void | @@ -558,26 +560,32 @@ void | |||
558 | dino_barrier(void *v, bus_space_handle_t h, bus_size_t o, bus_size_t l, int op) | 560 | dino_barrier(void *v, bus_space_handle_t h, bus_size_t o, bus_size_t l, int op) | |
559 | { | 561 | { | |
560 | sync_caches(); | 562 | sync_caches(); | |
561 | } | 563 | } | |
562 | 564 | |||
563 | void* | 565 | void* | |
564 | dino_vaddr(void *v, bus_space_handle_t h) | 566 | dino_vaddr(void *v, bus_space_handle_t h) | |
565 | { | 567 | { | |
566 | struct dino_softc *sc = v; | 568 | struct dino_softc *sc = v; | |
567 | 569 | |||
568 | return bus_space_vaddr(sc->sc_bt, h); | 570 | return bus_space_vaddr(sc->sc_bt, h); | |
569 | } | 571 | } | |
570 | 572 | |||
573 | paddr_t | |||
574 | dino_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags) | |||
575 | { | |||
576 | return -1; | |||
577 | } | |||
578 | ||||
571 | u_int8_t | 579 | u_int8_t | |
572 | dino_r1(void *v, bus_space_handle_t h, bus_size_t o) | 580 | dino_r1(void *v, bus_space_handle_t h, bus_size_t o) | |
573 | { | 581 | { | |
574 | h += o; | 582 | h += o; | |
575 | if (h & 0xf0000000) | 583 | if (h & 0xf0000000) | |
576 | return *(volatile u_int8_t *)h; | 584 | return *(volatile u_int8_t *)h; | |
577 | else { | 585 | else { | |
578 | struct dino_softc *sc = v; | 586 | struct dino_softc *sc = v; | |
579 | volatile struct dino_regs *r = sc->sc_regs; | 587 | volatile struct dino_regs *r = sc->sc_regs; | |
580 | 588 | |||
581 | r->pci_addr = h & ~3; | 589 | r->pci_addr = h & ~3; | |
582 | return *((volatile u_int8_t *)&r->pci_io_data + (h & 3)); | 590 | return *((volatile u_int8_t *)&r->pci_io_data + (h & 3)); | |
583 | } | 591 | } | |
@@ -1389,27 +1397,27 @@ dino_cp_8(void *v, bus_space_handle_t h1 | @@ -1389,27 +1397,27 @@ dino_cp_8(void *v, bus_space_handle_t h1 | |||
1389 | { | 1397 | { | |
1390 | while (c--) { | 1398 | while (c--) { | |
1391 | dino_w8(v, h1, o1, dino_r8(v, h2, o2)); | 1399 | dino_w8(v, h1, o1, dino_r8(v, h2, o2)); | |
1392 | o1 += 8; | 1400 | o1 += 8; | |
1393 | o2 += 8; | 1401 | o2 += 8; | |
1394 | } | 1402 | } | |
1395 | } | 1403 | } | |
1396 | 1404 | |||
1397 | 1405 | |||
1398 | const struct hppa_bus_space_tag dino_iomemt = { | 1406 | const struct hppa_bus_space_tag dino_iomemt = { | |
1399 | NULL, | 1407 | NULL, | |
1400 | 1408 | |||
1401 | NULL, dino_unmap, dino_subregion, NULL, dino_free, | 1409 | NULL, dino_unmap, dino_subregion, NULL, dino_free, | |
1402 | dino_barrier, dino_vaddr, | 1410 | dino_barrier, dino_vaddr, dino_mmap, | |
1403 | dino_r1, dino_r2, dino_r4, dino_r8, | 1411 | dino_r1, dino_r2, dino_r4, dino_r8, | |
1404 | dino_w1, dino_w2, dino_w4, dino_w8, | 1412 | dino_w1, dino_w2, dino_w4, dino_w8, | |
1405 | dino_rm_1, dino_rm_2, dino_rm_4, dino_rm_8, | 1413 | dino_rm_1, dino_rm_2, dino_rm_4, dino_rm_8, | |
1406 | dino_wm_1, dino_wm_2, dino_wm_4, dino_wm_8, | 1414 | dino_wm_1, dino_wm_2, dino_wm_4, dino_wm_8, | |
1407 | dino_sm_1, dino_sm_2, dino_sm_4, dino_sm_8, | 1415 | dino_sm_1, dino_sm_2, dino_sm_4, dino_sm_8, | |
1408 | dino_rrm_2, dino_rrm_4, dino_rrm_8, | 1416 | dino_rrm_2, dino_rrm_4, dino_rrm_8, | |
1409 | dino_wrm_2, dino_wrm_4, dino_wrm_8, | 1417 | dino_wrm_2, dino_wrm_4, dino_wrm_8, | |
1410 | dino_rr_1, dino_rr_2, dino_rr_4, dino_rr_8, | 1418 | dino_rr_1, dino_rr_2, dino_rr_4, dino_rr_8, | |
1411 | dino_wr_1, dino_wr_2, dino_wr_4, dino_wr_8, | 1419 | dino_wr_1, dino_wr_2, dino_wr_4, dino_wr_8, | |
1412 | dino_rrr_2, dino_rrr_4, dino_rrr_8, | 1420 | dino_rrr_2, dino_rrr_4, dino_rrr_8, | |
1413 | dino_wrr_2, dino_wrr_4, dino_wrr_8, | 1421 | dino_wrr_2, dino_wrr_4, dino_wrr_8, | |
1414 | dino_sr_1, dino_sr_2, dino_sr_4, dino_sr_8, | 1422 | dino_sr_1, dino_sr_2, dino_sr_4, dino_sr_8, | |
1415 | dino_cp_1, dino_cp_2, dino_cp_4, dino_cp_8 | 1423 | dino_cp_1, dino_cp_2, dino_cp_4, dino_cp_8 |
--- src/sys/arch/hp700/hp700/Attic/mainbus.c 2008/06/13 09:41:44 1.45
+++ src/sys/arch/hp700/hp700/Attic/mainbus.c 2009/09/29 22:56:48 1.45.6.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mainbus.c,v 1.45 2008/06/13 09:41:44 cegger Exp $ */ | 1 | /* $NetBSD: mainbus.c,v 1.45.6.1 2009/09/29 22:56:48 snj 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. | |
@@ -53,27 +53,27 @@ | @@ -53,27 +53,27 @@ | |||
53 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 53 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
54 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 54 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
55 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | 55 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | |
56 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 56 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
57 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 57 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
58 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 58 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
60 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 60 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
61 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 61 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
62 | * THE POSSIBILITY OF SUCH DAMAGE. | 62 | * THE POSSIBILITY OF SUCH DAMAGE. | |
63 | */ | 63 | */ | |
64 | 64 | |||
65 | #include <sys/cdefs.h> | 65 | #include <sys/cdefs.h> | |
66 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.45 2008/06/13 09:41:44 cegger Exp $"); | 66 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.45.6.1 2009/09/29 22:56:48 snj Exp $"); | |
67 | 67 | |||
68 | #include "locators.h" | 68 | #include "locators.h" | |
69 | #include "opt_power_switch.h" | 69 | #include "opt_power_switch.h" | |
70 | 70 | |||
71 | #include <sys/param.h> | 71 | #include <sys/param.h> | |
72 | #include <sys/systm.h> | 72 | #include <sys/systm.h> | |
73 | #include <sys/device.h> | 73 | #include <sys/device.h> | |
74 | #include <sys/reboot.h> | 74 | #include <sys/reboot.h> | |
75 | #include <sys/extent.h> | 75 | #include <sys/extent.h> | |
76 | #include <sys/mbuf.h> | 76 | #include <sys/mbuf.h> | |
77 | 77 | |||
78 | #include <uvm/uvm_page.h> | 78 | #include <uvm/uvm_page.h> | |
79 | #include <uvm/uvm.h> | 79 | #include <uvm/uvm.h> | |
@@ -146,26 +146,27 @@ void mbus_cp_1(void *, bus_space_handle_ | @@ -146,26 +146,27 @@ void mbus_cp_1(void *, bus_space_handle_ | |||
146 | void mbus_cp_2(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); | 146 | void mbus_cp_2(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); | |
147 | void mbus_cp_4(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); | 147 | void mbus_cp_4(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); | |
148 | void mbus_cp_8(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); | 148 | void mbus_cp_8(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, bus_size_t, bus_size_t); | |
149 | 149 | |||
150 | int mbus_add_mapping(bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 150 | int mbus_add_mapping(bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
151 | int mbus_remove_mapping(bus_space_handle_t, bus_size_t, bus_addr_t *); | 151 | int mbus_remove_mapping(bus_space_handle_t, bus_size_t, bus_addr_t *); | |
152 | int mbus_map(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 152 | int mbus_map(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
153 | void mbus_unmap(void *, bus_space_handle_t, bus_size_t); | 153 | void mbus_unmap(void *, bus_space_handle_t, bus_size_t); | |
154 | int mbus_alloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | 154 | int mbus_alloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | |
155 | void mbus_free(void *, bus_space_handle_t, bus_size_t); | 155 | void mbus_free(void *, bus_space_handle_t, bus_size_t); | |
156 | int mbus_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *); | 156 | int mbus_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *); | |
157 | void mbus_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | 157 | void mbus_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | |
158 | void *mbus_vaddr(void *, bus_space_handle_t); | 158 | void *mbus_vaddr(void *, bus_space_handle_t); | |
159 | paddr_t mbus_mmap(void *, bus_addr_t, off_t, int, int); | |||
159 | 160 | |||
160 | int mbus_dmamap_create(void *, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); | 161 | int mbus_dmamap_create(void *, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *); | |
161 | void mbus_dmamap_destroy(void *, bus_dmamap_t); | 162 | void mbus_dmamap_destroy(void *, bus_dmamap_t); | |
162 | int mbus_dmamap_load(void *, bus_dmamap_t, void *, bus_size_t, struct proc *, int); | 163 | int mbus_dmamap_load(void *, bus_dmamap_t, void *, bus_size_t, struct proc *, int); | |
163 | int mbus_dmamap_load_mbuf(void *, bus_dmamap_t, struct mbuf *, int); | 164 | int mbus_dmamap_load_mbuf(void *, bus_dmamap_t, struct mbuf *, int); | |
164 | int mbus_dmamap_load_uio(void *, bus_dmamap_t, struct uio *, int); | 165 | int mbus_dmamap_load_uio(void *, bus_dmamap_t, struct uio *, int); | |
165 | int mbus_dmamap_load_raw(void *, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); | 166 | int mbus_dmamap_load_raw(void *, bus_dmamap_t, bus_dma_segment_t *, int, bus_size_t, int); | |
166 | void mbus_dmamap_unload(void *, bus_dmamap_t); | 167 | void mbus_dmamap_unload(void *, bus_dmamap_t); | |
167 | void mbus_dmamap_sync(void *, bus_dmamap_t, bus_addr_t, bus_size_t, int); | 168 | void mbus_dmamap_sync(void *, bus_dmamap_t, bus_addr_t, bus_size_t, int); | |
168 | int mbus_dmamem_alloc(void *, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int); | 169 | int mbus_dmamem_alloc(void *, bus_size_t, bus_size_t, bus_size_t, bus_dma_segment_t *, int, int *, int); | |
169 | void mbus_dmamem_free(void *, bus_dma_segment_t *, int); | 170 | void mbus_dmamem_free(void *, bus_dma_segment_t *, int); | |
170 | int mbus_dmamem_map(void *, bus_dma_segment_t *, int, size_t, void **, int); | 171 | int mbus_dmamem_map(void *, bus_dma_segment_t *, int, size_t, void **, int); | |
171 | void mbus_dmamem_unmap(void *, void *, size_t); | 172 | void mbus_dmamem_unmap(void *, void *, size_t); | |
@@ -446,26 +447,33 @@ mbus_barrier(void *v, bus_space_handle_t | @@ -446,26 +447,33 @@ mbus_barrier(void *v, bus_space_handle_t | |||
446 | sync_caches(); | 447 | sync_caches(); | |
447 | } | 448 | } | |
448 | 449 | |||
449 | void* | 450 | void* | |
450 | mbus_vaddr(void *v, bus_space_handle_t h) | 451 | mbus_vaddr(void *v, bus_space_handle_t h) | |
451 | { | 452 | { | |
452 | /* | 453 | /* | |
453 | * We must only be called with addresses in I/O space. | 454 | * We must only be called with addresses in I/O space. | |
454 | */ | 455 | */ | |
455 | KASSERT(h >= HPPA_IOSPACE); | 456 | KASSERT(h >= HPPA_IOSPACE); | |
456 | return (void*)h; | 457 | return (void*)h; | |
457 | } | 458 | } | |
458 | 459 | |||
460 | paddr_t | |||
461 | mbus_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags) | |||
462 | { | |||
463 | ||||
464 | return -1; | |||
465 | } | |||
466 | ||||
459 | u_int8_t | 467 | u_int8_t | |
460 | mbus_r1(void *v, bus_space_handle_t h, bus_size_t o) | 468 | mbus_r1(void *v, bus_space_handle_t h, bus_size_t o) | |
461 | { | 469 | { | |
462 | return *((volatile u_int8_t *)(h + o)); | 470 | return *((volatile u_int8_t *)(h + o)); | |
463 | } | 471 | } | |
464 | 472 | |||
465 | u_int16_t | 473 | u_int16_t | |
466 | mbus_r2(void *v, bus_space_handle_t h, bus_size_t o) | 474 | mbus_r2(void *v, bus_space_handle_t h, bus_size_t o) | |
467 | { | 475 | { | |
468 | return *((volatile u_int16_t *)(h + o)); | 476 | return *((volatile u_int16_t *)(h + o)); | |
469 | } | 477 | } | |
470 | 478 | |||
471 | u_int32_t | 479 | u_int32_t | |
@@ -800,27 +808,27 @@ mbus_cp_8(void *v, bus_space_handle_t h1 | @@ -800,27 +808,27 @@ mbus_cp_8(void *v, bus_space_handle_t h1 | |||
800 | h1 += o1; | 808 | h1 += o1; | |
801 | h2 += o2; | 809 | h2 += o2; | |
802 | p1 = (void *)h1; | 810 | p1 = (void *)h1; | |
803 | p2 = (void *)h2; | 811 | p2 = (void *)h2; | |
804 | while (c--) | 812 | while (c--) | |
805 | *p1++ = *p2++; | 813 | *p1++ = *p2++; | |
806 | } | 814 | } | |
807 | 815 | |||
808 | 816 | |||
809 | const struct hppa_bus_space_tag hppa_bustag = { | 817 | const struct hppa_bus_space_tag hppa_bustag = { | |
810 | NULL, | 818 | NULL, | |
811 | 819 | |||
812 | mbus_map, mbus_unmap, mbus_subregion, mbus_alloc, mbus_free, | 820 | mbus_map, mbus_unmap, mbus_subregion, mbus_alloc, mbus_free, | |
813 | mbus_barrier, mbus_vaddr, | 821 | mbus_barrier, mbus_vaddr, mbus_mmap, | |
814 | mbus_r1, mbus_r2, mbus_r4, mbus_r8, | 822 | mbus_r1, mbus_r2, mbus_r4, mbus_r8, | |
815 | mbus_w1, mbus_w2, mbus_w4, mbus_w8, | 823 | mbus_w1, mbus_w2, mbus_w4, mbus_w8, | |
816 | mbus_rm_1, mbus_rm_2, mbus_rm_4, mbus_rm_8, | 824 | mbus_rm_1, mbus_rm_2, mbus_rm_4, mbus_rm_8, | |
817 | mbus_wm_1, mbus_wm_2, mbus_wm_4, mbus_wm_8, | 825 | mbus_wm_1, mbus_wm_2, mbus_wm_4, mbus_wm_8, | |
818 | mbus_sm_1, mbus_sm_2, mbus_sm_4, mbus_sm_8, | 826 | mbus_sm_1, mbus_sm_2, mbus_sm_4, mbus_sm_8, | |
819 | /* *_stream_* are the same as non-stream for native busses */ | 827 | /* *_stream_* are the same as non-stream for native busses */ | |
820 | mbus_rm_2, mbus_rm_4, mbus_rm_8, | 828 | mbus_rm_2, mbus_rm_4, mbus_rm_8, | |
821 | mbus_wm_2, mbus_wm_4, mbus_wm_8, | 829 | mbus_wm_2, mbus_wm_4, mbus_wm_8, | |
822 | mbus_rr_1, mbus_rr_2, mbus_rr_4, mbus_rr_8, | 830 | mbus_rr_1, mbus_rr_2, mbus_rr_4, mbus_rr_8, | |
823 | mbus_wr_1, mbus_wr_2, mbus_wr_4, mbus_wr_8, | 831 | mbus_wr_1, mbus_wr_2, mbus_wr_4, mbus_wr_8, | |
824 | /* *_stream_* are the same as non-stream for native busses */ | 832 | /* *_stream_* are the same as non-stream for native busses */ | |
825 | mbus_rr_2, mbus_rr_4, mbus_rr_8, | 833 | mbus_rr_2, mbus_rr_4, mbus_rr_8, | |
826 | mbus_wr_2, mbus_wr_4, mbus_wr_8, | 834 | mbus_wr_2, mbus_wr_4, mbus_wr_8, |
--- src/sys/arch/hp700/include/Attic/bus.h 2007/03/04 05:59:51 1.12
+++ src/sys/arch/hp700/include/Attic/bus.h 2009/09/29 22:56:48 1.12.54.1
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bus.h,v 1.12 2007/03/04 05:59:51 christos Exp $ */ | 1 | /* $NetBSD: bus.h,v 1.12.54.1 2009/09/29 22:56:48 snj Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: bus.h,v 1.13 2001/07/30 14:15:59 art Exp $ */ | 3 | /* $OpenBSD: bus.h,v 1.13 2001/07/30 14:15:59 art Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998,1999 Michael Shalayeff | 6 | * Copyright (c) 1998,1999 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 | |
@@ -54,26 +54,27 @@ struct hppa_bus_space_tag { | @@ -54,26 +54,27 @@ struct hppa_bus_space_tag { | |||
54 | void (*hbt_unmap)(void *v, bus_space_handle_t bsh, | 54 | void (*hbt_unmap)(void *v, bus_space_handle_t bsh, | |
55 | bus_size_t size); | 55 | bus_size_t size); | |
56 | int (*hbt_subregion)(void *v, bus_space_handle_t bsh, | 56 | int (*hbt_subregion)(void *v, bus_space_handle_t bsh, | |
57 | bus_size_t offset, bus_size_t size, | 57 | bus_size_t offset, bus_size_t size, | |
58 | bus_space_handle_t *nbshp); | 58 | bus_space_handle_t *nbshp); | |
59 | int (*hbt_alloc)(void *v, bus_addr_t rstart, bus_addr_t rend, | 59 | int (*hbt_alloc)(void *v, bus_addr_t rstart, bus_addr_t rend, | |
60 | bus_size_t size, bus_size_t align, | 60 | bus_size_t size, bus_size_t align, | |
61 | bus_size_t boundary, int flags, | 61 | bus_size_t boundary, int flags, | |
62 | bus_addr_t *addrp, bus_space_handle_t *bshp); | 62 | bus_addr_t *addrp, bus_space_handle_t *bshp); | |
63 | void (*hbt_free)(void *, bus_space_handle_t, bus_size_t); | 63 | void (*hbt_free)(void *, bus_space_handle_t, bus_size_t); | |
64 | void (*hbt_barrier)(void *v, bus_space_handle_t h, | 64 | void (*hbt_barrier)(void *v, bus_space_handle_t h, | |
65 | bus_size_t o, bus_size_t l, int op); | 65 | bus_size_t o, bus_size_t l, int op); | |
66 | void *(*hbt_vaddr)(void *, bus_space_handle_t); | 66 | void *(*hbt_vaddr)(void *, bus_space_handle_t); | |
67 | paddr_t (*hbt_mmap)(void *, bus_addr_t, off_t, int, int); | |||
67 | 68 | |||
68 | u_int8_t (*hbt_r1)(void *, bus_space_handle_t, bus_size_t); | 69 | u_int8_t (*hbt_r1)(void *, bus_space_handle_t, bus_size_t); | |
69 | u_int16_t (*hbt_r2)(void *, bus_space_handle_t, bus_size_t); | 70 | u_int16_t (*hbt_r2)(void *, bus_space_handle_t, bus_size_t); | |
70 | u_int32_t (*hbt_r4)(void *, bus_space_handle_t, bus_size_t); | 71 | u_int32_t (*hbt_r4)(void *, bus_space_handle_t, bus_size_t); | |
71 | u_int64_t (*hbt_r8)(void *, bus_space_handle_t, bus_size_t); | 72 | u_int64_t (*hbt_r8)(void *, bus_space_handle_t, bus_size_t); | |
72 | 73 | |||
73 | void (*hbt_w1)(void *, bus_space_handle_t, bus_size_t, u_int8_t); | 74 | void (*hbt_w1)(void *, bus_space_handle_t, bus_size_t, u_int8_t); | |
74 | void (*hbt_w2)(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 75 | void (*hbt_w2)(void *, bus_space_handle_t, bus_size_t, u_int16_t); | |
75 | void (*hbt_w4)(void *, bus_space_handle_t, bus_size_t, u_int32_t); | 76 | void (*hbt_w4)(void *, bus_space_handle_t, bus_size_t, u_int32_t); | |
76 | void (*hbt_w8)(void *, bus_space_handle_t, bus_size_t, u_int64_t); | 77 | void (*hbt_w8)(void *, bus_space_handle_t, bus_size_t, u_int64_t); | |
77 | 78 | |||
78 | void (*hbt_rm_1)(void *v, bus_space_handle_t h, | 79 | void (*hbt_rm_1)(void *v, bus_space_handle_t h, | |
79 | bus_size_t o, u_int8_t *a, bus_size_t c); | 80 | bus_size_t o, u_int8_t *a, bus_size_t c); | |
@@ -188,26 +189,28 @@ extern const struct hppa_bus_space_tag h | @@ -188,26 +189,28 @@ extern const struct hppa_bus_space_tag h | |||
188 | (((t)->hbt_map)((t)->hbt_cookie,(a),(c),(ca),(hp))) | 189 | (((t)->hbt_map)((t)->hbt_cookie,(a),(c),(ca),(hp))) | |
189 | #define bus_space_unmap(t,h,c) \ | 190 | #define bus_space_unmap(t,h,c) \ | |
190 | (((t)->hbt_unmap)((t)->hbt_cookie,(h),(c))) | 191 | (((t)->hbt_unmap)((t)->hbt_cookie,(h),(c))) | |
191 | #define bus_space_subregion(t,h,o,c,hp) \ | 192 | #define bus_space_subregion(t,h,o,c,hp) \ | |
192 | (((t)->hbt_subregion)((t)->hbt_cookie,(h),(o),(c),(hp))) | 193 | (((t)->hbt_subregion)((t)->hbt_cookie,(h),(o),(c),(hp))) | |
193 | #define bus_space_alloc(t,b,e,c,al,bn,ca,ap,hp) \ | 194 | #define bus_space_alloc(t,b,e,c,al,bn,ca,ap,hp) \ | |
194 | (((t)->hbt_alloc)((t)->hbt_cookie,(b),(e),(c),(al),(bn),(ca),(ap),(hp))) | 195 | (((t)->hbt_alloc)((t)->hbt_cookie,(b),(e),(c),(al),(bn),(ca),(ap),(hp))) | |
195 | #define bus_space_free(t,h,c) \ | 196 | #define bus_space_free(t,h,c) \ | |
196 | (((t)->hbt_free)((t)->hbt_cookie,(h),(c))) | 197 | (((t)->hbt_free)((t)->hbt_cookie,(h),(c))) | |
197 | #define bus_space_barrier(t,h,o,l,op) \ | 198 | #define bus_space_barrier(t,h,o,l,op) \ | |
198 | ((t)->hbt_barrier((t)->hbt_cookie, (h), (o), (l), (op))) | 199 | ((t)->hbt_barrier((t)->hbt_cookie, (h), (o), (l), (op))) | |
199 | #define bus_space_vaddr(t,h) \ | 200 | #define bus_space_vaddr(t,h) \ | |
200 | (((t)->hbt_vaddr)((t)->hbt_cookie,(h))) | 201 | (((t)->hbt_vaddr)((t)->hbt_cookie,(h))) | |
202 | #define bus_space_mmap(t, a, o, p, f) \ | |||
203 | (*(t)->hbt_mmap)((t)->hbt_cookie, (a), (o), (p), (f)) | |||
201 | 204 | |||
202 | #define bus_space_read_1(t,h,o) (((t)->hbt_r1)((t)->hbt_cookie,(h),(o))) | 205 | #define bus_space_read_1(t,h,o) (((t)->hbt_r1)((t)->hbt_cookie,(h),(o))) | |
203 | #define bus_space_read_2(t,h,o) (((t)->hbt_r2)((t)->hbt_cookie,(h),(o))) | 206 | #define bus_space_read_2(t,h,o) (((t)->hbt_r2)((t)->hbt_cookie,(h),(o))) | |
204 | #define bus_space_read_4(t,h,o) (((t)->hbt_r4)((t)->hbt_cookie,(h),(o))) | 207 | #define bus_space_read_4(t,h,o) (((t)->hbt_r4)((t)->hbt_cookie,(h),(o))) | |
205 | #define bus_space_read_8(t,h,o) (((t)->hbt_r8)((t)->hbt_cookie,(h),(o))) | 208 | #define bus_space_read_8(t,h,o) (((t)->hbt_r8)((t)->hbt_cookie,(h),(o))) | |
206 | 209 | |||
207 | #define bus_space_write_1(t,h,o,v) (((t)->hbt_w1)((t)->hbt_cookie,(h),(o),(v))) | 210 | #define bus_space_write_1(t,h,o,v) (((t)->hbt_w1)((t)->hbt_cookie,(h),(o),(v))) | |
208 | #define bus_space_write_2(t,h,o,v) (((t)->hbt_w2)((t)->hbt_cookie,(h),(o),(v))) | 211 | #define bus_space_write_2(t,h,o,v) (((t)->hbt_w2)((t)->hbt_cookie,(h),(o),(v))) | |
209 | #define bus_space_write_4(t,h,o,v) (((t)->hbt_w4)((t)->hbt_cookie,(h),(o),(v))) | 212 | #define bus_space_write_4(t,h,o,v) (((t)->hbt_w4)((t)->hbt_cookie,(h),(o),(v))) | |
210 | #define bus_space_write_8(t,h,o,v) (((t)->hbt_w8)((t)->hbt_cookie,(h),(o),(v))) | 213 | #define bus_space_write_8(t,h,o,v) (((t)->hbt_w8)((t)->hbt_cookie,(h),(o),(v))) | |
211 | 214 | |||
212 | /* XXX fredette */ | 215 | /* XXX fredette */ | |
213 | #define __BUS_SPACE_HAS_STREAM_METHODS | 216 | #define __BUS_SPACE_HAS_STREAM_METHODS |