summaryrefslogtreecommitdiff
path: root/src/arch/x86/lib/memcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/lib/memcpy.c')
-rw-r--r--src/arch/x86/lib/memcpy.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/arch/x86/lib/memcpy.c b/src/arch/x86/lib/memcpy.c
index de210928a3..f8607cfc50 100644
--- a/src/arch/x86/lib/memcpy.c
+++ b/src/arch/x86/lib/memcpy.c
@@ -1,13 +1,15 @@
#include <string.h>
-void *memcpy(void *__restrict __dest,
- __const void *__restrict __src, size_t __n)
+void *memcpy(void *dest, const void *src, size_t n)
{
- asm("cld\n"
- "rep\n"
- "movsb"
- : /* no input (?) */
- :"S"(__src), "D"(__dest), "c"(__n)
- );
- return __dest;
+ unsigned long d0, d1, d2;
+
+ asm volatile(
+ "rep movsb"
+ : "=S"(d0), "=D"(d1), "=c"(d2)
+ : "0"(src), "1"(dest), "2"(n)
+ : "memory"
+ );
+
+ return dest;
}