empb_bsm.c revision 1.1 1 /* $NetBSD: empb_bsm.c,v 1.1 2012/06/01 09:41:35 rkujawa Exp $ */
2
3 /*-
4 * Copyright (c) 2012 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Radoslaw Kujawa.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
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
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
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
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
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 /*
33 * Special bus space methods handling PCI memory window.
34 */
35
36 #include <sys/bus.h>
37 #include <sys/null.h>
38 #include <sys/param.h>
39 #include <sys/device.h>
40 #include <sys/systm.h>
41
42 #include <amiga/pci/empbreg.h>
43 #include <amiga/pci/empbvar.h>
44 #include <amiga/pci/emmemvar.h>
45
46
47
48
49 const struct amiga_bus_space_methods empb_bus_swap = {
50 /*.bsm = empb_bsm,
51 .bsms = empb_bsms,
52 .bsu = empb_bsu,
53 .bsa = NULL,
54 .bsf = NULL,
55
56 .bsr1 = empb_bsr1,
57 .bsw1 = empb_bsw1,
58 .bsrm1 = empb_bsrm1,
59 .bswm1 = empb_bswm1,
60 .bsrr1 = empb_bsrr1,
61 .bswr1 = empb_bswr1,
62 .bssr1 = empb_bssr1,
63 .bscr1 = empb_bscr1,
64
65 .bsr2 = oabs(bsr2_), // XXX swap?
66 .bsw2 = oabs(bsw2_), // XXX swap?
67 .bsrs2 = oabs(bsr2_),
68 .bsws2 = oabs(bsw2_),
69 .bsrm2 = oabs(bsrm2_swap_),
70 .bswm2 = oabs(bswm2_swap_),
71 .bsrms2 = oabs(bsrm2_),
72 .bswms2 = oabs(bswm2_),
73 .bsrr2 = oabs(bsrr2_), // XXX swap?
74 .bswr2 = oabs(bswr2_), // XXX swap?
75 .bsrrs2 = oabs(bsrr2_),
76 .bswrs2 = oabs(bswr2_),
77 .bssr2 = oabs(bssr2_), // XXX swap?
78 .bscr2 = oabs(bscr2_), // XXX swap?
79
80 .bsr4 = oabs(bsr4_swap_),
81 .bsw4 = oabs(bsw4_swap_),
82 .bsrs4 = oabs(bsr4_),
83 .bsws4 = oabs(bsw4_),
84 .bsrm4 = oabs(bsrm4_), // XXX swap?
85 .bswm4 = oabs(bswm4_), // XXX swap?
86 .bsrms4 = oabs(bsrm4_),
87 .bswms4 = oabs(bswm4_),
88 .bsrr4 = oabs(bsrr4_), // XXX swap?
89 .bswr4 = oabs(bswr4_), // XXX swap?
90 .bsrrs4 = oabs(bsrr4_),
91 .bswrs4 = oabs(bswr4_),
92 .bssr4 = oabs(bssr4_), // XXX swap?
93 .bscr4 = oabs(bscr4_) // XXX swap? */
94 };
95
96