2 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
3 * Copyright (C) 2004 Microtronix Datacom Ltd
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/types.h>
11 #include <linux/string.h>
13 #ifdef __HAVE_ARCH_MEMMOVE
14 void *memmove(void *d
, const void *s
, size_t count
)
16 unsigned long dst
, src
;
22 dst
= (unsigned long) d
;
23 src
= (unsigned long) s
;
25 if ((count
< 8) || ((dst
^ src
) & 3))
29 *(char *)dst
++ = *(char *)src
++;
33 *(short *)dst
= *(short *)src
;
39 *(long *)dst
= *(long *)src
;
46 *(char *)dst
++ = *(char *)src
++;
48 dst
= (unsigned long) d
+ count
;
49 src
= (unsigned long) s
+ count
;
51 if ((count
< 8) || ((dst
^ src
) & 3))
58 *(char *)dst
= *(char *)src
;
64 *(short *)dst
= *(short *)src
;
70 *(long *)dst
= *(long *)src
;
76 *(char *)dst
= *(char *)src
;
82 #endif /* __HAVE_ARCH_MEMMOVE */