aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-07-07 16:05:17 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-07-07 16:05:17 -0700
commit95543286c5d1587aac92c1cb7d3a51f9dd1c1696 (patch)
treebdabd6f09661fae47a03263514624c0a3154d336
parent18e266792a8bbd155f53c91703d18248adf83690 (diff)
downloadklibc-95543286c5d1587aac92c1cb7d3a51f9dd1c1696.tar.gz
[klibc] memmove: when we do std, we need to also cldklibc-1.5.12
After doing std, we absolutely need to cld afterwards (the compiler has the right to assume DF=0, and we do elsewhere.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--usr/klibc/memmove.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/klibc/memmove.c b/usr/klibc/memmove.c
index 659c77850605b..a398cd8dc986b 100644
--- a/usr/klibc/memmove.c
+++ b/usr/klibc/memmove.c
@@ -10,12 +10,12 @@ void *memmove(void *dst, const void *src, size_t n)
char *q = dst;
#if defined(__i386__) || defined(__x86_64__)
if (q < p) {
- asm volatile("cld ; rep ; movsb"
+ asm volatile("cld; rep; movsb"
: "+c" (n), "+S"(p), "+D"(q));
} else {
p += (n - 1);
q += (n - 1);
- asm volatile("std ; rep ; movsb"
+ asm volatile("std; rep; movsb; cld"
: "+c" (n), "+S"(p), "+D"(q));
}
#else