use USER_CPPFLAGS
[AROS.git] / arch / m68k-all / exec / cachecontrol.c
blob073c1dc7bd3d37f6b7f08da0151b315acd53d3e1
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CacheControl() - Global control of the system caches.
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
13 /* See rom/exec/cachecontrol.c for documentation */
15 extern void AROS_SLIB_ENTRY(CacheControl_00,Exec,108)(void);
16 extern void AROS_SLIB_ENTRY(CacheControl_20,Exec,108)(void);
17 extern void AROS_SLIB_ENTRY(CacheControl_40,Exec,108)(void);
19 #include <proto/exec.h>
21 AROS_LH2(ULONG, CacheControl,
22 AROS_LHA(ULONG, cacheBits, D0),
23 AROS_LHA(ULONG, cacheMask, D1),
24 struct ExecBase *, SysBase, 108, Exec)
26 AROS_LIBFUNC_INIT
27 void (*func)(void);
29 Disable();
30 if (SysBase->AttnFlags & AFF_68040) {
31 /* 68040/68060 support */
32 func = AROS_SLIB_ENTRY(CacheControl_40, Exec, 108);
33 } else if (SysBase->AttnFlags & AFF_68020) {
34 /* 68020/68030 support */
35 func = AROS_SLIB_ENTRY(CacheControl_20, Exec, 108);
36 } else {
37 /* Everybody else (68000, 68010) */
38 func = AROS_SLIB_ENTRY(CacheControl_00, Exec, 108);
40 SetFunction((struct Library *)SysBase, -LIB_VECTSIZE * 108, func);
41 Enable();
43 return CacheControl(cacheBits, cacheMask);
45 AROS_LIBFUNC_EXIT
46 } /* CacheControl */