2005-04-17 06:20:36 +08:00
|
|
|
/* Normally compiler builtins are used, but sometimes the compiler calls out
|
|
|
|
of line code. Based on asm-i386/string.h.
|
|
|
|
*/
|
|
|
|
#define _STRING_C
|
|
|
|
#include <linux/string.h>
|
2006-06-26 19:59:44 +08:00
|
|
|
#include <linux/module.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#undef memmove
|
2008-02-20 03:53:38 +08:00
|
|
|
void *memmove(void *dest, const void *src, size_t count)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2008-02-20 03:53:38 +08:00
|
|
|
if (dest < src) {
|
|
|
|
return memcpy(dest, src, count);
|
2005-04-17 06:20:36 +08:00
|
|
|
} else {
|
2008-01-30 20:33:23 +08:00
|
|
|
char *p = dest + count;
|
|
|
|
const char *s = src + count;
|
2005-04-17 06:20:36 +08:00
|
|
|
while (count--)
|
|
|
|
*--p = *--s;
|
|
|
|
}
|
|
|
|
return dest;
|
2008-02-20 03:53:38 +08:00
|
|
|
}
|
2006-06-26 19:59:44 +08:00
|
|
|
EXPORT_SYMBOL(memmove);
|