1358a8972387d28b580ac354eeff79f11ef35a31
[AROS.git] / arch / m68k-mac / exec / cache.c
blob1358a8972387d28b580ac354eeff79f11ef35a31
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 #if 0
11 #include <asm/cachectl.h>
12 /* GNU libc 2 has this included in <sys/syscall.h>, but libc5 doesn't :-( */
13 #include <asm/unistd.h>
14 static inline _syscall4(int,cacheflush,unsigned long,addr,int,scope,int,cache,unsigned long,len)
15 #endif
17 /******************************************************************************
19 NAME */
20 #include <proto/exec.h>
21 #include <exec/execbase.h>
23 AROS_LH3(void, CacheClearE,
25 /* SYNOPSIS */
26 AROS_LHA(APTR, address, A0),
27 AROS_LHA(ULONG, length, D0),
28 AROS_LHA(ULONG, caches, D1),
30 /* LOCATION */
31 struct ExecBase *, SysBase, 107, Exec)
33 /* FUNCTION
35 INPUTS
37 RESULT
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 HISTORY
51 ******************************************************************************/
53 AROS_LIBFUNC_INIT
54 #if 0
55 ULONG scope, cpucache = 0;
57 if (caches & CACRF_ClearD)
58 cpucache |= FLUSH_CACHE_DATA;
60 if (caches & CACRF_ClearI)
61 cpucache |= FLUSH_CACHE_INSN;
63 if (length == (ULONG)-1)
64 scope = FLUSH_SCOPE_ALL;
65 else
66 scope = FLUSH_SCOPE_LINE;
68 (void) cacheflush((unsigned long)address, scope, cpucache, length);
69 #endif
70 AROS_LIBFUNC_EXIT
71 } /* CacheClearE */
73 /******************************************************************************
75 NAME */
76 #include <proto/exec.h>
78 AROS_LH0(void, CacheClearU,
80 /* LOCATION */
81 struct ExecBase *, SysBase, 106, Exec)
83 /* FUNCTION
85 INPUTS
87 RESULT
89 NOTES
91 EXAMPLE
93 BUGS
95 SEE ALSO
97 INTERNALS
99 HISTORY
101 ******************************************************************************/
103 AROS_LIBFUNC_INIT
104 #if 0
105 (void) cacheflush(0, FLUSH_SCOPE_ALL, FLUSH_CACHE_BOTH, 0);
106 #endif
107 AROS_LIBFUNC_EXIT
108 } /* CacheClearU */