linux/arch/m68knommu/lib/memcpy.c
Ralf Baechle 911f21501f Remove inclusions of <linux/autoconf.h>
Nothing should ever include this file.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: "Mike Frysinger" <vapier.adi@gmail.com>
Acked-by: "Bryan Wu" <cooloney.lkml@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:00 -08:00

63 lines
1.0 KiB
C

#include <linux/types.h>
void * memcpy(void * to, const void * from, size_t n)
{
#ifdef CONFIG_COLDFIRE
void *xto = to;
size_t temp;
if (!n)
return xto;
if ((long) to & 1)
{
char *cto = to;
const char *cfrom = from;
*cto++ = *cfrom++;
to = cto;
from = cfrom;
n--;
}
if (n > 2 && (long) to & 2)
{
short *sto = to;
const short *sfrom = from;
*sto++ = *sfrom++;
to = sto;
from = sfrom;
n -= 2;
}
temp = n >> 2;
if (temp)
{
long *lto = to;
const long *lfrom = from;
for (; temp; temp--)
*lto++ = *lfrom++;
to = lto;
from = lfrom;
}
if (n & 2)
{
short *sto = to;
const short *sfrom = from;
*sto++ = *sfrom++;
to = sto;
from = sfrom;
}
if (n & 1)
{
char *cto = to;
const char *cfrom = from;
*cto = *cfrom;
}
return xto;
#else
const char *c_from = from;
char *c_to = to;
while (n-- > 0)
*c_to++ = *c_from++;
return((void *) to);
#endif
}