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