revert between 56095 -> 55830 in arch
[AROS.git] / arch / .unmaintained / m68k-linux / exec / cache.c
blob61b6eedaeb2150d4459df4ddf8d18596c2c6a18d
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Flush Caches
6 Lang: english
7 */
8 #include <errno.h>
9 #include <asm/cachectl.h>
10 /* GNU libc 2 has this included in <sys/syscall.h>, but libc5 doesn't :-( */
11 #include <asm/unistd.h>
12 static inline _syscall4(int,cacheflush,unsigned long,addr,int,scope,int,cache,unsigned long,len)
14 /******************************************************************************
16 NAME */
17 #include <proto/exec.h>
18 #include <exec/execbase.h>
20 AROS_LH3(void, CacheClearE,
22 /* SYNOPSIS */
23 AROS_LHA(APTR, address, A0),
24 AROS_LHA(ULONG, length, D0),
25 AROS_LHA(ULONG, caches, D1),
27 /* LOCATION */
28 struct ExecBase *, SysBase, 107, Exec)
30 /* FUNCTION
32 INPUTS
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 HISTORY
48 ******************************************************************************/
50 int scope, cpucache = 0;
52 if (caches & CACRF_ClearD)
53 cpucache |= FLUSH_CACHE_DATA;
55 if (caches & CACRF_ClearI)
56 cpucache |= FLUSH_CACHE_INSN;
58 if (length == (ULONG)-1)
59 scope = FLUSH_SCOPE_ALL;
60 else
61 scope = FLUSH_SCOPE_LINE;
63 (void) cacheflush((unsigned long)address, scope, cpucache, length);
64 } /* CacheClearE */
66 /******************************************************************************
68 NAME */
69 #include <proto/exec.h>
71 AROS_LH0(void, CacheClearU,
73 /* LOCATION */
74 struct ExecBase *, SysBase, 106, Exec)
76 /* FUNCTION
78 INPUTS
80 RESULT
82 NOTES
84 EXAMPLE
86 BUGS
88 SEE ALSO
90 INTERNALS
92 HISTORY
94 ******************************************************************************/
96 (void) cacheflush(0, FLUSH_SCOPE_ALL, FLUSH_CACHE_BOTH, 0);
97 } /* CacheClearU */