config: fix build with external compiler by passing the sysroot where needed
[AROS.git] / arch / .unmaintained / m68k-emul / cache.c
blob02b960c45ef231a960d4e2c9193cdba8dfde440d
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Flush Caches
6 Lang: english
7 */
9 #include <errno.h>
10 #include <asm/cachectl.h>
11 /* GNU libc 2 has this included in <sys/syscall.h>, but libc5 doesn't :-( */
12 #include <asm/unistd.h>
13 static inline _syscall4(int,cacheflush,unsigned long,addr,int,scope,int,cache,unsigned long,len)
15 /******************************************************************************
17 NAME */
18 #include <proto/exec.h>
19 #include <exec/execbase.h>
21 AROS_LH3(void, CacheClearE,
23 /* SYNOPSIS */
24 AROS_LHA(APTR, address, A0),
25 AROS_LHA(ULONG, length, D0),
26 AROS_LHA(ULONG, caches, D1),
28 /* LOCATION */
29 struct ExecBase *, SysBase, 107, Exec)
31 /* FUNCTION
33 INPUTS
35 RESULT
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 HISTORY
49 ******************************************************************************/
51 int scope, cpucache = 0;
53 if (caches & CACRF_ClearD)
54 cpucache |= FLUSH_CACHE_DATA;
56 if (caches & CACRF_ClearI)
57 cpucache |= FLUSH_CACHE_INSN;
59 if (length == (ULONG)-1)
60 scope = FLUSH_SCOPE_ALL;
61 else
62 scope = FLUSH_SCOPE_LINE;
64 (void) cacheflush((unsigned long)address, scope, cpucache, length);
65 } /* CacheClearE */
67 /******************************************************************************
69 NAME */
70 #include <proto/exec.h>
72 AROS_LH0(void, CacheClearU,
74 /* LOCATION */
75 struct ExecBase *, SysBase, 106, Exec)
77 /* FUNCTION
79 INPUTS
81 RESULT
83 NOTES
85 EXAMPLE
87 BUGS
89 SEE ALSO
91 INTERNALS
93 HISTORY
95 ******************************************************************************/
97 (void) cacheflush(0, FLUSH_SCOPE_ALL, FLUSH_CACHE_BOTH, 0);
98 } /* CacheClearU */
100 /******************************************************************************
102 NAME */
103 #include <proto/exec.h>
105 AROS_LH0(void, CacheControl,
107 /* LOCATION */
108 struct ExecBase *, SysBase, 108, Exec)
110 /* FUNCTION
112 INPUTS
114 RESULT
116 NOTES
118 EXAMPLE
120 BUGS
122 SEE ALSO
124 INTERNALS
126 HISTORY
128 ******************************************************************************/
130 return;
131 } /* CacheControl */
133 /******************************************************************************
135 NAME */
136 #include <proto/exec.h>
138 AROS_LH0(void, CachePostDMA,
140 /* LOCATION */
141 struct ExecBase *, SysBase, 128, Exec)
143 /* FUNCTION
145 INPUTS
147 RESULT
149 NOTES
151 EXAMPLE
153 BUGS
155 SEE ALSO
157 INTERNALS
159 HISTORY
161 ******************************************************************************/
163 return;
164 } /* CachePostDMA */
166 /******************************************************************************
168 NAME */
169 #include <proto/exec.h>
171 AROS_LH0(void, CachePreDMA,
173 /* LOCATION */
174 struct ExecBase *, SysBase, 127, Exec)
176 /* FUNCTION
178 INPUTS
180 RESULT
182 NOTES
184 EXAMPLE
186 BUGS
188 SEE ALSO
190 INTERNALS
192 HISTORY
194 ******************************************************************************/
196 return;
197 } /* CachePreDMA */