2005-04-17 00:20:36 +02: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 13:59:44 +02:00
|
|
|
#include <linux/module.h>
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
#undef memmove
|
2008-02-19 20:53:38 +01:00
|
|
|
void *memmove(void *dest, const void *src, size_t count)
|
2005-04-17 00:20:36 +02:00
|
|
|
{
|
2008-02-19 20:53:38 +01:00
|
|
|
if (dest < src) {
|
|
|
|
return memcpy(dest, src, count);
|
2005-04-17 00:20:36 +02:00
|
|
|
} else {
|
2008-01-30 13:33:23 +01:00
|
|
|
char *p = dest + count;
|
|
|
|
const char *s = src + count;
|
2005-04-17 00:20:36 +02:00
|
|
|
while (count--)
|
|
|
|
*--p = *--s;
|
|
|
|
}
|
|
|
|
return dest;
|
2008-02-19 20:53:38 +01:00
|
|
|
}
|
2006-06-26 13:59:44 +02:00
|
|
|
EXPORT_SYMBOL(memmove);
|