xref: /netbsd/sys/arch/m68k/include/cacheops.h (revision bf9ec67e)
1 /*	$NetBSD: cacheops.h,v 1.8 2000/04/05 19:38:33 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(pa)	DCIAS_20((pa))
63 #define	PCIA()		PCIA_20()
64 
65 #elif defined(M68030) && !(defined(M68020)||defined(M68040)||defined(M68060))
66 
67 #define	TBIA()		TBIA_30()
68 #define	TBIS(va)	TBIS_30((va))
69 #define	TBIAS()		TBIAS_30()
70 #define	TBIAU()		TBIAU_30()
71 #define	ICIA()		ICIA_30()
72 #define	ICPA()		ICPA_30()
73 #define	DCIA()		DCIA_30()
74 #define	DCIS()		DCIS_30()
75 #define	DCIU()		DCIU_30()
76 #define	DCIAS(pa)	DCIAS_30((pa))
77 #define	PCIA()		PCIA_30()
78 
79 #elif defined(M68040) && !(defined(M68020)||defined(M68030)||defined(M68060))
80 
81 #define	TBIA()		TBIA_40()
82 #define	TBIS(va)	TBIS_40((va))
83 #define	TBIAS()		TBIAS_40()
84 #define	TBIAU()		TBIAU_40()
85 #define	ICIA()		ICIA_40()
86 #define	ICPA()		ICPA_40()
87 #define	DCIA()		DCIA_40()
88 #define	DCIS()		DCIS_40()
89 #define	DCIU()		DCIU_40()
90 #define	DCIAS(pa)	DCIAS_40((pa))
91 #define	PCIA()		PCIA_40()
92 #define	DCFA()		DCFA_40()
93 #define	ICPL(pa)	ICPL_40((pa))
94 #define	ICPP(pa)	ICPP_40((pa))
95 #define	DCPL(pa)	DCPL_40((pa))
96 #define	DCPP(pa)	DCPP_40((pa))
97 #define	DCPA()		DCPA_40()
98 #define	DCFL(pa)	DCFL_40((pa))
99 #define	DCFP(pa)	DCFP_40((pa))
100 
101 #elif defined(M68060) && !(defined(M68020)||defined(M68030)||defined(M68040))
102 
103 #define	TBIA()		TBIA_60()
104 #define	TBIS(va)	TBIS_60((va))
105 #define	TBIAS()		TBIAS_60()
106 #define	TBIAU()		TBIAU_60()
107 #define	ICIA()		ICIA_60()
108 #define	ICPA()		ICPA_60()
109 #define	DCIA()		DCIA_60()
110 #define	DCIS()		DCIS_60()
111 #define	DCIU()		DCIU_60()
112 #define	DCIAS(pa)	DCIAS_60((pa))
113 #define	PCIA()		PCIA_60()
114 #define	DCFA()		DCFA_60()
115 #define	ICPL(pa)	ICPL_60((pa))
116 #define	ICPP(pa)	ICPP_60((pa))
117 #define	DCPL(pa)	DCPL_60((pa))
118 #define	DCPP(pa)	DCPP_60((pa))
119 #define	DCPA()		DCPA_60()
120 #define	DCFL(pa)	DCFL_60((pa))
121 #define	DCFP(pa)	DCFP_60((pa))
122 
123 #else /* Multi-CPU config */
124 
125 /* XXX: From cpuconf.h? */
126 #ifndef _MULTI_CPU
127 #define	_MULTI_CPU
128 #endif
129 
130 void	_TBIA __P((void));
131 void	_TBIS __P((vaddr_t));
132 void	_TBIAS __P((void));
133 void	_TBIAU __P((void));
134 void	_ICIA __P((void));
135 void	_ICPA __P((void));
136 void	_DCIA __P((void));
137 void	_DCIS __P((void));
138 void	_DCIU __P((void));
139 void	_DCIAS __P((paddr_t));
140 void	_PCIA __P((void));
141 
142 #define	TBIA()		_TBIA()
143 #define	TBIS(va)	_TBIS((va))
144 #define	TBIAS()		_TBIAS()
145 #define	TBIAU()		_TBIAU()
146 #define	ICIA()		_ICIA()
147 #define	ICPA()		_ICPA()
148 #define	DCIA()		_DCIA()
149 #define	DCIS()		_DCIS()
150 #define	DCIU()		_DCIU()
151 #define	DCIAS(pa)	_DCIAS((pa))
152 #define	PCIA()		_PCIA()
153 
154 #if defined(M68040)||defined(M68060)
155 
156 void	_DCFA __P((void));
157 void	_ICPL __P((paddr_t));
158 void	_ICPP __P((paddr_t));
159 void	_DCPL __P((paddr_t));
160 void	_DCPP __P((paddr_t));
161 void	_DCPA __P((void));
162 void	_DCFL __P((paddr_t));
163 void	_DCFP __P((paddr_t));
164 
165 #define	DCFA()		_DCFA()
166 #define	ICPL(pa)	_ICPL((pa))
167 #define	ICPP(pa)	_ICPP((pa))
168 #define	DCPL(pa)	_DCPL((pa))
169 #define	DCPP(pa)	_DCPP((pa))
170 #define	DCPA()		_DCPA()
171 #define	DCFL(pa)	_DCFL((pa))
172 #define	DCFP(pa)	_DCFP((pa))
173 
174 #endif /* defined(M68040)||defined(M68060) */
175 
176 #endif
177 
178 #endif /* _M68K_CACHEOPS_H_ */
179