https://github.com/torvalds/linux
Raw File
Tip revision: 57f8f7b60db6f1ed2c6918ab9230c4623a9dbe37 authored by Linus Torvalds on 24 October 2008, 03:06:52 UTC
Linux 2.6.28-rc1
Tip revision: 57f8f7b
memmove_64.c
/* 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>
#include <linux/module.h>

#undef memmove
void *memmove(void *dest, const void *src, size_t count)
{
	if (dest < src) {
		return memcpy(dest, src, count);
	} else {
		char *p = dest + count;
		const char *s = src + count;
		while (count--)
			*--p = *--s;
	}
	return dest;
}
EXPORT_SYMBOL(memmove);
back to top