From 0054afa11daa8db78dbe6aa55150238525187596 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 25 Oct 2011 23:43:34 +0000 Subject: Add faster, architecture dependent memcpy() Change-Id: I38d15f3f1ec65f0cb7974d2dd4ae6356433bddd8 Signed-off-by: Stefan Reinauer Reviewed-by: Duncan Laurie Reviewed-on: http://review.coreboot.org/736 Reviewed-by: Ronald G. Minnich Tested-by: build bot (Jenkins) --- src/arch/x86/lib/memcpy.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/arch/x86/lib/memcpy.c (limited to 'src/arch/x86/lib/memcpy.c') diff --git a/src/arch/x86/lib/memcpy.c b/src/arch/x86/lib/memcpy.c new file mode 100644 index 0000000000..de210928a3 --- /dev/null +++ b/src/arch/x86/lib/memcpy.c @@ -0,0 +1,13 @@ +#include + +void *memcpy(void *__restrict __dest, + __const void *__restrict __src, size_t __n) +{ + asm("cld\n" + "rep\n" + "movsb" + : /* no input (?) */ + :"S"(__src), "D"(__dest), "c"(__n) + ); + return __dest; +} -- cgit v1.2.3