Removed autodocs of arch specific variants of ROM modules.
[AROS.git] / arch / m68k-all / exec / cacheclearu.c
blobf5baf3311a7bb68a5f3ba9bd9f508416b5eed1f3
1 /*
2 Copyright © 1995-2013, 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 extern void AROS_SLIB_ENTRY(CacheClearU_00,Exec,106)(void);
14 extern void AROS_SLIB_ENTRY(CacheClearU_20,Exec,106)(void);
15 extern void AROS_SLIB_ENTRY(CacheClearU_40,Exec,106)(void);
16 extern void AROS_SLIB_ENTRY(CacheClearU_60,Exec,106)(void);
18 #include <proto/exec.h>
20 /* See rom/exec/cacheclearu.c for documentation */
22 AROS_LH0(void, CacheClearU,
23 struct ExecBase *, SysBase, 106, Exec)
25 AROS_LIBFUNC_INIT
26 void (*func)(void);
28 if (SysBase->LibNode.lib_OpenCnt == 0)
29 /* We were called from PrepareExecBase. AttnFlags isn't set yet.
30 * Do nothing or we would always install 68000 routine.
31 * No harm done, caches are disabled at this point.
33 return;
35 /* When called the first time, this patches up the
36 * Exec syscall table to directly point to the right routine.
37 * NOTE: We may have been originally called from SetFunction()
38 * We must clear caches before calling SetFunction()
41 Disable();
42 if (SysBase->AttnFlags & AFF_68060) {
43 /* 68060 support */
44 func = AROS_SLIB_ENTRY(CacheClearU_60, Exec, 106);
45 } else if (SysBase->AttnFlags & AFF_68040) {
46 /* 68040 support */
47 func = AROS_SLIB_ENTRY(CacheClearU_40, Exec, 106);
48 } else if (SysBase->AttnFlags & AFF_68020) {
49 /* 68020 support */
50 func = AROS_SLIB_ENTRY(CacheClearU_20, Exec, 106);
51 } else {
52 /* Everybody else (68000, 68010) */
53 func = AROS_SLIB_ENTRY(CacheClearU_00, Exec, 106);
55 func();
56 SetFunction((struct Library *)SysBase, -LIB_VECTSIZE * 106, func);
57 Enable();
59 AROS_LIBFUNC_EXIT
60 } /* CacheClearU */