Port the SB128 code to AROS.
[AROS.git] / rom / exec / cacheclearu.c
blob73afed7a8d2da4d0e5d30b291b0d2d6c64e691f9
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CacheClearU - Simple way of clearing the caches.
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
13 /*****************************************************************************
15 NAME */
16 #include <proto/exec.h>
18 AROS_LH0(void, CacheClearU,
20 /* LOCATION */
21 struct ExecBase *, SysBase, 106, Exec)
23 /* FUNCTION
24 Flush the entire contents of the CPU instruction and data caches.
25 If some of the cache contains dirty data, push it to memory first.
27 For most systems DMA will not effect processor caches. If *any*
28 external (non-processor) event changes system memory, you MUST
29 clear the cache. For example:
31 DMA
32 Code relocation to run at a different address
33 Building jump tables
34 Loading code from disk
36 INPUTS
38 RESULT
39 The caches will be flushed.
41 NOTES
42 It is possible that on some systems the entire cache will be
43 even if this was not the specific request.
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 CacheClearE(), CacheControl(), CachePreDMA(), CachePostDMA()
52 INTERNALS
53 Although it is not necessary, but it could be more efficient if
54 this function was replaced by a function in $(KERNEL).
56 ******************************************************************************/
58 AROS_LIBFUNC_INIT
60 /* Just dump the whole lot */
61 CacheClearE(0, ~0, CACRF_ClearI | CACRF_ClearD);
63 AROS_LIBFUNC_EXIT
64 } /* CacheClearU */