]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - arch/x86/lib/memmove_64.c
Merge branches 'topic/fix/asoc', 'topic/fix/hda', 'topic/fix/misc' and 'topic/pci...
[mirror_ubuntu-zesty-kernel.git] / arch / x86 / lib / memmove_64.c
CommitLineData
1da177e4
LT
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>
2ee60e17 6#include <linux/module.h>
1da177e4
LT
7
8#undef memmove
e9406597 9void *memmove(void *dest, const void *src, size_t count)
1da177e4 10{
e9406597
PC
11 if (dest < src) {
12 return memcpy(dest, src, count);
1da177e4 13 } else {
ade1af77
JE
14 char *p = dest + count;
15 const char *s = src + count;
1da177e4
LT
16 while (count--)
17 *--p = *--s;
18 }
19 return dest;
e9406597 20}
2ee60e17 21EXPORT_SYMBOL(memmove);