cacheops.h revision 1.10 1 1.10 thorpej /* $NetBSD: cacheops.h,v 1.10 2004/08/28 21:31:07 thorpej Exp $ */
2 1.1 leo
3 1.1 leo /*-
4 1.1 leo * Copyright (c) 1997 The NetBSD Foundation, Inc.
5 1.1 leo * All rights reserved.
6 1.1 leo *
7 1.1 leo * This code is derived from software contributed to The NetBSD Foundation
8 1.1 leo * by Leo Weppelman
9 1.1 leo *
10 1.1 leo * Redistribution and use in source and binary forms, with or without
11 1.1 leo * modification, are permitted provided that the following conditions
12 1.1 leo * are met:
13 1.1 leo * 1. Redistributions of source code must retain the above copyright
14 1.1 leo * notice, this list of conditions and the following disclaimer.
15 1.1 leo * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 leo * notice, this list of conditions and the following disclaimer in the
17 1.1 leo * documentation and/or other materials provided with the distribution.
18 1.1 leo * 3. All advertising materials mentioning features or use of this software
19 1.1 leo * must display the following acknowledgement:
20 1.1 leo * This product includes software developed by the NetBSD
21 1.1 leo * Foundation, Inc. and its contributors.
22 1.1 leo * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 leo * contributors may be used to endorse or promote products derived
24 1.1 leo * from this software without specific prior written permission.
25 1.1 leo *
26 1.1 leo * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 leo * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 leo * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 leo * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 leo * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 leo * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 leo * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 leo * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 leo * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 leo * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 leo * POSSIBILITY OF SUCH DAMAGE.
37 1.1 leo */
38 1.1 leo
39 1.4 minoura #ifndef _M68K_CACHEOPS_H_
40 1.4 minoura #define _M68K_CACHEOPS_H_
41 1.4 minoura
42 1.1 leo #if notyet /* XXX */
43 1.1 leo #include <machine/cpuconf.h>
44 1.1 leo #endif
45 1.1 leo
46 1.1 leo #include <m68k/cacheops_20.h>
47 1.1 leo #include <m68k/cacheops_30.h>
48 1.1 leo #include <m68k/cacheops_40.h>
49 1.1 leo #include <m68k/cacheops_60.h>
50 1.1 leo
51 1.9 chs #define M68K_CACHEOPS_NTYPES (defined(M68K_CACHEOPS_MACHDEP) + \
52 1.9 chs defined(M68020) + defined(M68030) + defined(M68040) + defined(M68060))
53 1.9 chs
54 1.9 chs #if M68K_CACHEOPS_NTYPES == 1
55 1.9 chs
56 1.9 chs #if defined(M68020)
57 1.1 leo
58 1.1 leo #define DCIA() DCIA_20()
59 1.9 chs #define DCIAS(pa) DCIAS_20((pa))
60 1.1 leo #define DCIS() DCIS_20()
61 1.1 leo #define DCIU() DCIU_20()
62 1.9 chs #define ICIA() ICIA_20()
63 1.9 chs #define ICPA() ICPA_20()
64 1.1 leo #define PCIA() PCIA_20()
65 1.9 chs #define TBIA() TBIA_20()
66 1.9 chs #define TBIAS() TBIAS_20()
67 1.9 chs #define TBIAU() TBIAU_20()
68 1.9 chs #define TBIS(va) TBIS_20((va))
69 1.1 leo
70 1.9 chs #elif defined(M68030)
71 1.1 leo
72 1.1 leo #define DCIA() DCIA_30()
73 1.9 chs #define DCIAS(pa) DCIAS_30((pa))
74 1.1 leo #define DCIS() DCIS_30()
75 1.1 leo #define DCIU() DCIU_30()
76 1.9 chs #define ICIA() ICIA_30()
77 1.9 chs #define ICPA() ICPA_30()
78 1.1 leo #define PCIA() PCIA_30()
79 1.9 chs #define TBIA() TBIA_30()
80 1.9 chs #define TBIAS() TBIAS_30()
81 1.9 chs #define TBIAU() TBIAU_30()
82 1.9 chs #define TBIS(va) TBIS_30((va))
83 1.1 leo
84 1.9 chs #elif defined(M68040)
85 1.1 leo
86 1.9 chs #define DCFA() DCFA_40()
87 1.9 chs #define DCFL(pa) DCFL_40((pa))
88 1.9 chs #define DCFP(pa) DCFP_40((pa))
89 1.1 leo #define DCIA() DCIA_40()
90 1.9 chs #define DCIAS(pa) DCIAS_40((pa))
91 1.1 leo #define DCIS() DCIS_40()
92 1.1 leo #define DCIU() DCIU_40()
93 1.9 chs #define DCPA() DCPA_40()
94 1.9 chs #define DCPL(pa) DCPL_40((pa))
95 1.9 chs #define DCPP(pa) DCPP_40((pa))
96 1.9 chs #define ICIA() ICIA_40()
97 1.9 chs #define ICPA() ICPA_40()
98 1.5 is #define ICPL(pa) ICPL_40((pa))
99 1.5 is #define ICPP(pa) ICPP_40((pa))
100 1.9 chs #define PCIA() PCIA_40()
101 1.9 chs #define TBIA() TBIA_40()
102 1.9 chs #define TBIAS() TBIAS_40()
103 1.9 chs #define TBIAU() TBIAU_40()
104 1.9 chs #define TBIS(va) TBIS_40((va))
105 1.1 leo
106 1.9 chs #elif defined(M68060)
107 1.1 leo
108 1.9 chs #define DCFA() DCFA_60()
109 1.9 chs #define DCFL(pa) DCFL_60((pa))
110 1.9 chs #define DCFP(pa) DCFP_60((pa))
111 1.1 leo #define DCIA() DCIA_60()
112 1.9 chs #define DCIAS(pa) DCIAS_60((pa))
113 1.1 leo #define DCIS() DCIS_60()
114 1.1 leo #define DCIU() DCIU_60()
115 1.9 chs #define DCPA() DCPA_60()
116 1.9 chs #define DCPL(pa) DCPL_60((pa))
117 1.9 chs #define DCPP(pa) DCPP_60((pa))
118 1.9 chs #define ICIA() ICIA_60()
119 1.9 chs #define ICPA() ICPA_60()
120 1.5 is #define ICPL(pa) ICPL_60((pa))
121 1.5 is #define ICPP(pa) ICPP_60((pa))
122 1.9 chs #define PCIA() PCIA_60()
123 1.9 chs #define TBIA() TBIA_60()
124 1.9 chs #define TBIAS() TBIAS_60()
125 1.9 chs #define TBIAU() TBIAU_60()
126 1.9 chs #define TBIS(va) TBIS_60((va))
127 1.1 leo
128 1.1 leo #endif
129 1.1 leo
130 1.9 chs #else /* M68K_CACHEOPS_NTYPES == 1 */
131 1.1 leo
132 1.9 chs #define DCFA() _DCFA()
133 1.9 chs #define DCFL(pa) _DCFL((pa))
134 1.9 chs #define DCFP(pa) _DCFP((pa))
135 1.1 leo #define DCIA() _DCIA()
136 1.9 chs #define DCIAS(pa) _DCIAS((pa))
137 1.1 leo #define DCIS() _DCIS()
138 1.1 leo #define DCIU() _DCIU()
139 1.9 chs #define DCPA() _DCPA()
140 1.9 chs #define DCPL(pa) _DCPL((pa))
141 1.9 chs #define DCPP(pa) _DCPP((pa))
142 1.9 chs #define ICIA() _ICIA()
143 1.9 chs #define ICPA() _ICPA()
144 1.9 chs #define ICPL(pa) _ICPL((pa))
145 1.9 chs #define ICPP(pa) _ICPP((pa))
146 1.8 is #define PCIA() _PCIA()
147 1.9 chs #define TBIA() _TBIA()
148 1.9 chs #define TBIAS() _TBIAS()
149 1.9 chs #define TBIAU() _TBIAU()
150 1.9 chs #define TBIS(va) _TBIS((va))
151 1.1 leo
152 1.9 chs #endif /* M68K_CACHEOPS_NTYPES == 1 */
153 1.1 leo
154 1.10 thorpej void _DCFA(void);
155 1.10 thorpej void _DCFL(paddr_t);
156 1.10 thorpej void _DCFP(paddr_t);
157 1.10 thorpej void _DCIA(void);
158 1.10 thorpej void _DCIAS(paddr_t);
159 1.10 thorpej void _DCIS(void);
160 1.10 thorpej void _DCIU(void);
161 1.10 thorpej void _DCPA(void);
162 1.10 thorpej void _DCPL(paddr_t);
163 1.10 thorpej void _DCPP(paddr_t);
164 1.10 thorpej void _ICIA(void);
165 1.10 thorpej void _ICPA(void);
166 1.10 thorpej void _ICPL(paddr_t);
167 1.10 thorpej void _ICPP(paddr_t);
168 1.10 thorpej void _PCIA(void);
169 1.10 thorpej void _TBIA(void);
170 1.10 thorpej void _TBIAS(void);
171 1.10 thorpej void _TBIAU(void);
172 1.10 thorpej void _TBIS(vaddr_t);
173 1.4 minoura
174 1.4 minoura #endif /* _M68K_CACHEOPS_H_ */
175