grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / exec / cachecleare.c
blob9fac2810ee08a267babd96e0b0a23441f878abbc
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CacheClearE() - Clear the caches with extended control.
6 Lang: english
7 */
9 #include <aros/debug.h>
10 #include <exec/types.h>
11 #include <exec/execbase.h>
12 #include <aros/libcall.h>
14 /*****************************************************************************
16 NAME */
17 #include <proto/exec.h>
19 AROS_LH3(void, CacheClearE,
21 /* SYNOPSIS */
22 AROS_LHA(APTR, address, A0),
23 AROS_LHA(IPTR, length, D0),
24 AROS_LHA(ULONG, caches, D1),
26 /* LOCATION */
27 struct ExecBase *, SysBase, 107, Exec)
29 /* FUNCTION
30 Flush the contents of the CPU instruction or data caches. If some
31 of the cache contains dirty data, push it to memory first.
33 For most systems DMA will not effect processor caches. If *any*
34 external (non-processor) event changes system memory, you MUST
35 clear the cache. For example:
37 DMA
38 Code relocation to run at a different address
39 Building jump tables
40 Loading code from disk
42 INPUTS
43 address - Address to start the operation. This address may be
44 rounded DOWN due to hardware granularity.
45 length - Length of the memory to flush. This will be rounded
46 up, of $FFFFFFFF to indicate that all addresses
47 should be cleared.
48 caches - Bit flags to indicate which caches should be cleared
50 CACRF_ClearI - Clear the instruction cache
51 CACRF_ClearD - Clear the data cache
53 All other bits are reserved.
55 RESULT
56 The caches will be flushed.
58 NOTES
59 It is possible that on some systems the entire cache will be
60 even if this was not the specific request.
62 EXAMPLE
64 BUGS
66 SEE ALSO
67 CacheClearU(), CacheControl()
69 INTERNALS
70 This is a rather CPU dependant function. You should replace it
71 in your $(KERNEL).
73 ******************************************************************************/
75 AROS_LIBFUNC_INIT
77 /* This function is entirely architecture-specific. Replace when needed. */
79 AROS_LIBFUNC_EXIT
80 } /* CacheClearE */