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