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