2 Copyright © 1995-2013, 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 extern void AROS_SLIB_ENTRY(CachePreDMA_00
,Exec
,127)(void);
16 extern void AROS_SLIB_ENTRY(CachePreDMA_40
,Exec
,127)(void);
18 #include <proto/exec.h>
20 /* See rom/exec/cachepredma.c for documentation */
22 AROS_LH3(APTR
, CachePreDMA
,
23 AROS_LHA(APTR
, address
, A0
),
24 AROS_LHA(ULONG
*, length
, A1
),
25 AROS_LHA(ULONG
, flags
, D0
),
26 struct ExecBase
*, SysBase
, 127, Exec
)
31 /* When called the first time, this patches up the
32 * Exec syscall table to directly point to the right routine.
35 if (SysBase
->AttnFlags
& AFF_68040
) {
37 func
= AROS_SLIB_ENTRY(CachePreDMA_40
, Exec
, 127);
39 /* Everybody else (68000, 68010) */
40 func
= AROS_SLIB_ENTRY(CachePreDMA_00
, Exec
, 127);
43 SetFunction((struct Library
*)SysBase
, -LIB_VECTSIZE
* 127, func
);
46 /* Call 'myself', which is now pointing to the correct routine */
47 return CachePreDMA(address
, length
, flags
);