2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: CachePreDMA() - Do what is necessary for DMA.
11 #include <aros/debug.h>
12 #include <exec/types.h>
13 #include <aros/libcall.h>
15 /*****************************************************************************
18 #include <proto/exec.h>
20 AROS_NTLH3(APTR
, CachePreDMA
,
23 AROS_LHA(APTR
, address
, A0
),
24 AROS_LHA(ULONG
*, length
, A1
),
25 AROS_LHA(ULONG
, flags
, D0
),
28 struct ExecBase
*, SysBase
, 127, Exec
)
31 Do everything necessary to make CPU caches aware that a DMA
32 will happen. Virtual memory systems will make it possible
33 that your memory is not at one block and not at the address
34 you thought. This function gives you all the information
35 you need to split the DMA request up and to convert virtual
36 to physical addresses.
39 address - Virtual address of memory affected by the DMA
40 *length - Number of bytes affected
41 flags - DMA_Continue - This is a call to continue a
42 request that was broken up.
43 DMA_ReadFromRAM - Indicate that the DMA goes from
44 RAM to the device. Set this bit
48 The physical address in memory.
49 *length contains the number of contiguous bytes in physical
53 DMA must follow a call to CachePreDMA() and must be followed
54 by a call to CachePostDMA().
64 This function should be replaced by a function in $(KERNEL).
66 ******************************************************************************/
71 * Due to the strong cache coherency of x86 systems this function
72 * is actually not needed. CPU snoops the address lines and
73 * invalidate all cache which is out-of-date. It is valid for both
74 * D and I caches). Even a BM-DMA transfer are perfectly safe here.