2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 /******************************************************************************
10 AROS_LH3(void, CachePostDMA,
13 AROS_LHA(APTR, address, A0),
14 AROS_LHA(ULONG *, length, A1),
15 AROS_LHA(ULONG, flags, D0),
18 struct ExecBase *, SysBase, 128, Exec)
21 Do everything necessary to make CPU caches aware that a DMA has
25 address - Virtual address of memory affected by the DMA
26 *length - Number of bytes affected
27 flags - DMA_NoModify - Indicate that the memory did not change.
28 DMA_ReadFromRAM - Indicate that the DMA goes from RAM
29 to the device. Set this bit in bot calls.
34 DMA must follow a call to CachePreDMA() and must be followed
35 by a call to CachePostDMA().
48 ******************************************************************************/
51 XDEF AROS_SLIB_ENTRY(CachePostDMA,Exec) ; for 68000/10/20
52 XDEF AROS_SLIB_ENTRY(CachePostDMA_30,Exec) ; for 68030+
53 XDEF AROS_SLIB_ENTRY(CachePostDMA_40,Exec) ; for 68040/68060
60 .globl AROS_SLIB_ENTRY(CachePostDMA,Exec)
61 .type AROS_SLIB_ENTRY(CachePostDMA,Exec),@function
62 AROS_SLIB_ENTRY
(CachePostDMA
,Exec
):
67 .globl AROS_SLIB_ENTRY(CachePostDMA_30,Exec)
68 .type AROS_SLIB_ENTRY(CachePostDMA_30,Exec),@function
69 AROS_SLIB_ENTRY
(CachePostDMA_30
,Exec
):
70 btst.
l #DMAB_NoModify,d0 /* Has DMA modified data in mem? */
71 bne.s cpd_30_end
/* nope, just exit */
72 move.
l a5
,a1
/* save a5 */
73 lea.
l cachepostdmasup_30
(pc
),a5
80 /* A DMA device has changed data in main memory. We have to clear
81 the data cache, so we get the chance to see this new data. */
82 or.w
#0x0700,sr /* Disable interrupts */
84 bset.
l #11,d0 /* Set CD Clear Data cache bit */
90 .globl AROS_SLIB_ENTRY(CachePostDMA_40,Exec)
91 .type AROS_SLIB_ENTRY(CachePostDMA_40,Exec),@function
92 AROS_SLIB_ENTRY
(CachePostDMA_40
,Exec
):
93 btst.
l #DMAB_NoModify,d0 /* Has DMA modified data in mem? */
94 bne.s cpd_40_end
/* nope, just exit */
95 move.
l a5
,a1
/* save a5 */
96 lea.
l cachepostdmasup_40
(pc
),a5
103 /* A DMA device has changed data in main memory. We have to invalidate
104 the data cache, so we get the chance to see this new data. */