1 /*--------------------------------------------------------------------
3 * arch/nios2nommu/lib/memcpy.c
5 * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al
7 * Copyright (C) 2004 Microtronix Datacom Ltd
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
20 * Jun/09/2004 dgt Split out separate source file from string.c
22 ---------------------------------------------------------------------*/
24 #include <linux/types.h>
25 #include <linux/autoconf.h>
27 #include <asm/string.h>
29 #ifdef __HAVE_ARCH_MEMCPY
30 void * memcpy(void * d
, const void * s
, size_t count
)
32 unsigned long dst
, src
;
33 dst
= (unsigned long) d
;
34 src
= (unsigned long) s
;
36 if ((count
< 8) || ((dst
^ src
) & 3))
40 *(char*)dst
++=*(char*)src
++;
44 *(short*)dst
=*(short*)src
;
50 *(long*)dst
=*(long*)src
;
58 *(char*)dst
++=*(char*)src
++;