2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 /*****************************************************************************
10 AROS_LH0(void, CacheClearU,
13 struct ExecBase *, SysBase, 106, Exec)
16 Flushes the contents of all CPU caches in a simple way.
32 68020/30: clear instruction cache and (030) data cache
33 68040/60: push dirty lines to memory and invalidate both caches
37 ******************************************************************************/
41 XDEF AROS_SLIB_ENTRY(CacheClearU,Exec) ; for 68000/68010
42 XDEF AROS_SLIB_ENTRY(CacheClearU_20,Exec) ; for 68020/68030
43 XDEF AROS_SLIB_ENTRY(CacheClearU_40,Exec) ; for 68040/68060
44 XDEF AROS_SLIB_ENTRY(CacheClearU_60,Exec) ; for 68060 (clears not only
45 ; the i and d caches, but also
53 .globl AROS_SLIB_ENTRY(CacheClearU,Exec)
54 .type AROS_SLIB_ENTRY(CacheClearU,Exec),@function
55 AROS_SLIB_ENTRY
(CacheClearU
,Exec
):
56 /* Simple 68000s have no chaches */
61 .globl AROS_SLIB_ENTRY(CacheClearU_20,Exec)
62 .type AROS_SLIB_ENTRY(CacheClearU_20,Exec),@function
63 AROS_SLIB_ENTRY
(CacheClearU_20
,Exec
):
64 move.
l a5
,a1
/* Save a5 */
65 lea.
l cacheclearusup_20
(pc
),a5
66 jmp Supervisor
(a6
) /* No jsr: this saves an rts */
69 or.w
#0x0700,sr /* Disable interrupts so cacr can not be influenced
70 while we clear the caches */
72 or.w
#0x0808,d0 /* Set CD and CI bit in cacr */
74 move.
l a1
,a5
/* Restore a5 */
75 rte
/* This rte will restore the SR from the stack */
79 .globl AROS_SLIB_ENTRY(CacheClearU_40,Exec)
80 .type AROS_SLIB_ENTRY(CacheClearU_40,Exec),@function
81 AROS_SLIB_ENTRY
(CacheClearU_40
,Exec
):
83 lea.
l cacheclearusup_40
(pc
),a5
87 cpusha
bc /* Push dirty cache lines to memory and invalidate both caches */
88 cinva
bc /* 68060 invalidates depending on DPI (Disable CPUSH invalidation)
89 bit of CACR. Force an invalidation with CINV. */
95 .globl AROS_SLIB_ENTRY(CacheClearU_60,Exec)
96 .type AROS_SLIB_ENTRY(CacheClearU_60,Exec),@function
97 AROS_SLIB_ENTRY
(CacheClearU_60
,Exec
):
99 lea.
l cacheclearusup_60
(pc
),a5
103 cpusha
bc /* Push dirty cache lines to memory and invalidate both caches */
104 cinva
bc /* 68060 invalidates depending on DPI (Disable CPUSH invalidation)
105 bit of CACR. Force an invalidation with CINV. */
108 bset.
l #20,d0 /* set CABC Clear All (entries in) Branch Cache bit */
109 movec d0
,cacr
/* clear Branch Cache */