2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
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 /******************************************************************************
18 #include <proto/exec.h>
19 #include <exec/execbase.h>
21 AROS_LH3(void, CacheClearE
,
24 AROS_LHA(APTR
, address
, A0
),
25 AROS_LHA(ULONG
, length
, D0
),
26 AROS_LHA(ULONG
, caches
, D1
),
29 struct ExecBase
*, SysBase
, 107, Exec
)
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
;
62 scope
= FLUSH_SCOPE_LINE
;
64 (void) cacheflush((unsigned long)address
, scope
, cpucache
, length
);
67 /******************************************************************************
70 #include <proto/exec.h>
72 AROS_LH0(void, CacheClearU
,
75 struct ExecBase
*, SysBase
, 106, Exec
)
95 ******************************************************************************/
97 (void) cacheflush(0, FLUSH_SCOPE_ALL
, FLUSH_CACHE_BOTH
, 0);
100 /******************************************************************************
103 #include <proto/exec.h>
105 AROS_LH0(void, CacheControl
,
108 struct ExecBase
*, SysBase
, 108, Exec
)
128 ******************************************************************************/
133 /******************************************************************************
136 #include <proto/exec.h>
138 AROS_LH0(void, CachePostDMA
,
141 struct ExecBase
*, SysBase
, 128, Exec
)
161 ******************************************************************************/
166 /******************************************************************************
169 #include <proto/exec.h>
171 AROS_LH0(void, CachePreDMA
,
174 struct ExecBase
*, SysBase
, 127, Exec
)
194 ******************************************************************************/