| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* Normally compiler builtins are used, but sometimes the compiler calls out | 
 | 2 |    of line code. Based on asm-i386/string.h. | 
 | 3 |  */ | 
 | 4 | #define _STRING_C | 
 | 5 | #include <linux/string.h> | 
| Andi Kleen | 2ee60e17 | 2006-06-26 13:59:44 +0200 | [diff] [blame] | 6 | #include <linux/module.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 |  | 
 | 8 | #undef memmove | 
 | 9 | void *memmove(void * dest,const void *src,size_t count) | 
 | 10 | { | 
 | 11 | 	if (dest < src) {  | 
| Andi Kleen | 6bfa9bb | 2006-06-26 13:59:47 +0200 | [diff] [blame] | 12 | 		return memcpy(dest,src,count); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | 	} else { | 
 | 14 | 		char *p = (char *) dest + count; | 
 | 15 | 		char *s = (char *) src + count; | 
 | 16 | 		while (count--) | 
 | 17 | 			*--p = *--s; | 
 | 18 | 	} | 
 | 19 | 	return dest; | 
 | 20 | }  | 
| Andi Kleen | 2ee60e17 | 2006-06-26 13:59:44 +0200 | [diff] [blame] | 21 | EXPORT_SYMBOL(memmove); |