aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/lib/memmove.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/lib/memmove.c')
-rw-r--r--arch/x86_64/lib/memmove.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86_64/lib/memmove.c b/arch/x86_64/lib/memmove.c
new file mode 100644
index 000000000000..e93d5255fdc9
--- /dev/null
+++ b/arch/x86_64/lib/memmove.c
@@ -0,0 +1,19 @@
1/* Normally compiler builtins are used, but sometimes the compiler calls out
2 of line code. Based on asm-i386/string.h.
3 */
4#define _STRING_C
5#include <linux/string.h>
6
7#undef memmove
8void *memmove(void * dest,const void *src,size_t count)
9{
10 if (dest < src) {
11 __inline_memcpy(dest,src,count);
12 } else {
13 char *p = (char *) dest + count;
14 char *s = (char *) src + count;
15 while (count--)
16 *--p = *--s;
17 }
18 return dest;
19}