f698fecc90dad33ec2477d686490b3bd4c37b8fa
[AROS.git] / arch / m68k-all / exec / copymem.c
blobf698fecc90dad33ec2477d686490b3bd4c37b8fa
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CopyMem()
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/execbase.h>
11 #include <proto/exec.h>
12 #include <aros/libcall.h>
14 extern void AROS_SLIB_ENTRY(CopyMem_000,Exec,104)(void);
15 extern void AROS_SLIB_ENTRY(CopyMem_020,Exec,104)(void);
17 /*****************************************************************************
19 NAME */
21 AROS_LH3I(void, CopyMem,
23 /* SYNOPSIS */
24 AROS_LHA(CONST_APTR, source, A0),
25 AROS_LHA(APTR, dest, A1),
26 AROS_LHA(IPTR, size, D0),
28 /* LOCATION */
29 struct ExecBase *, SysBase, 104, Exec)
31 /* FUNCTION
32 Copy some memory from one destination in memory to another using
33 a fast copying method.
35 INPUTS
36 source - Pointer to source area
37 dest - Pointer to destination
38 size - number of bytes to copy (may be zero)
40 RESULT
42 NOTES
43 The source and destination area are not allowed to overlap.
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 CopyMemQuick()
52 INTERNALS
54 ******************************************************************************/
56 AROS_LIBFUNC_INIT
57 void (*func)(void);
59 Disable();
60 if (SysBase->AttnFlags & AFF_68020) {
61 /* 68020+ */
62 func = AROS_SLIB_ENTRY(CopyMem_020, Exec, 104);
63 } else {
64 /* 68000/68010 */
65 func = AROS_SLIB_ENTRY(CopyMem_000, Exec, 104);
67 SetFunction((struct Library *)SysBase, -LIB_VECTSIZE * 104, func);
68 Enable();
70 return CopyMem(source, dest, size);
72 AROS_LIBFUNC_EXIT
73 } /* CopyMem */