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 void *memmove(void *d
, const void *s
, size_t count
)
15 unsigned long dst
, src
;
21 dst
= (unsigned long) d
;
22 src
= (unsigned long) s
;
24 if ((count
< 8) || ((dst
^ src
) & 3))
28 *(char *)dst
++ = *(char *)src
++;
32 *(short *)dst
= *(short *)src
;
38 *(long *)dst
= *(long *)src
;
45 *(char *)dst
++ = *(char *)src
++;
47 dst
= (unsigned long) d
+ count
;
48 src
= (unsigned long) s
+ count
;
50 if ((count
< 8) || ((dst
^ src
) & 3))
57 *(char *)dst
= *(char *)src
;
63 *(short *)dst
= *(short *)src
;
69 *(long *)dst
= *(long *)src
;
75 *(char *)dst
= *(char *)src
;