dont try to convert the pixfmt while calculating the "shade"
[AROS.git] / arch / m68k-all / exec / cacheclearu_.S
blob2464260c31f911942274ebe145a87ba5c42615aa
1 /*
2     Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3     $Id$
4 */
6 /*****************************************************************************
8     NAME
9  
10         AROS_LH0(void, CacheClearU,
12     LOCATION
13         struct ExecBase *, SysBase, 106, Exec)
15     FUNCTION
16         Flushes the contents of all CPU caches in a simple way.
18     INPUTS
20     RESULT
22     NOTES
24     EXAMPLE
26     BUGS
28     SEE ALSO
30     INTERNALS
31         68000/10: do nothing
32         68020/30: clear instruction cache and (030) data cache
33         68040/60: push dirty lines to memory and invalidate both caches
35     HISTORY
37 ******************************************************************************/
41    XDEF AROS_SLIB_ENTRY(CacheClearU_00,Exec,106)        ; for 68000/68010
42    XDEF AROS_SLIB_ENTRY(CacheClearU_20,Exec,106)        ; for 68020/68030
43    XDEF AROS_SLIB_ENTRY(CacheClearU_40,Exec,106)        ; for 68040/68060
44    XDEF AROS_SLIB_ENTRY(CacheClearU_60,Exec,106)        ; for 68060 (clears not only
45                                                 ; the i and d caches, but also
46                                                 ; the branch cache)
49         #include "aros/m68k/asm.h"
50         #include "cache.h"
52         .text
53         .balign 4
54         .globl  AROS_SLIB_ENTRY(CacheClearU_00,Exec,106)
55         .type   AROS_SLIB_ENTRY(CacheClearU_00,Exec,106),@function
56 AROS_SLIB_ENTRY(CacheClearU_00,Exec,106):
57         /* Simple 68000s have no chaches */
59 #if CACHEDEBUG
60         bsr             cachedebug
61 #endif
63         rts
65         .text
66         .balign 4
67         .globl  AROS_SLIB_ENTRY(CacheClearU_20,Exec,106)
68         .type   AROS_SLIB_ENTRY(CacheClearU_20,Exec,106),@function
69 AROS_SLIB_ENTRY(CacheClearU_20,Exec,106):
71 #if CACHEDEBUG
72         bsr             cachedebug
73 #endif
75         move.l  %a5,%a1         /* Save a5 */
76         lea.l   cacheclearusup_20,%a5
77         jmp     Supervisor(%a6) /* No jsr: this saves an rts */
79 cacheclearusup_20:
80         or.w    #0x0700,%sr     /* Disable interrupts so cacr can not be influenced
81                                    while we clear the caches */
82         movec   %cacr,%d0
83         or.w    #0x0808,%d0     /* Set CD and CI bit in cacr */
84         movec   %d0,%cacr
85         move.l  %a1,%a5         /* Restore a5 */
86         rte                     /* This rte will restore the SR from the stack */
88         .text
89         .balign 4
90         .globl  AROS_SLIB_ENTRY(CacheClearU_40,Exec,106)
91         .type   AROS_SLIB_ENTRY(CacheClearU_40,Exec,106),@function
92 AROS_SLIB_ENTRY(CacheClearU_40,Exec,106):
94 #if CACHEDEBUG
95         bsr             cachedebug
96 #endif
98         move.l  %a5,%a1
99         lea.l   cacheclearusup_40,%a5
100         jmp     Supervisor(%a6)
102         .text
103         .balign 4
104         .globl  AROS_SLIB_ENTRY(CacheClearU_60,Exec,106)
105         .type   AROS_SLIB_ENTRY(CacheClearU_60,Exec,106),@function
106 AROS_SLIB_ENTRY(CacheClearU_60,Exec,106):
108 #if CACHEDEBUG
109         bsr             cachedebug
110 #endif
112         move.l  %a5,%a1
113         lea.l   cacheclearusup_60,%a5
114         jmp     Supervisor(%a6)
116 cacheclearusup_40:
117         nop /* old 68040 revision bug workaround */
118 cacheclearusup_60:
119         cpusha  %bc     /* Push dirty cache lines to memory and invalidate both caches */
120         move.l  %a1,%a5
121         rte
123 #if CACHEDEBUG
124 cachedebug:
125         movem.l %d0-%d1/%a0-%a1,-(%sp)
126         pea format
127         jsr kprintf
128         addq.l #4,%sp
129         movem.l (%sp)+,%d0-%d1/%a0-%a1
130         rts
131 format:
132         .string "CU()\n"
133 #endif