aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules/mboot.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-03-03 16:55:15 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-03-03 16:55:15 -0800
commit6a3dfed789e30191406785ad013619984fba6dda (patch)
tree02c4994c742c0ecac43ee99dd568686ed68750bc /com32/modules/mboot.c
parentd89b4716c23bd63d068a2fcad66613d7c9b77cc9 (diff)
downloadsyslinux.git-6a3dfed789e30191406785ad013619984fba6dda.tar.gz
syslinux.git-6a3dfed789e30191406785ad013619984fba6dda.tar.xz
syslinux.git-6a3dfed789e30191406785ad013619984fba6dda.zip
Drop unnecessary CLD instructions.
The EFI ABI spec states that DF=0 on ABI boundaries, and gcc expects this. Assume it is safe to rely upon everywhere; drop unnecessary cld instructions, except on entry and (obviously) after std.
Diffstat (limited to 'com32/modules/mboot.c')
-rw-r--r--com32/modules/mboot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/com32/modules/mboot.c b/com32/modules/mboot.c
index 3d744256..6c3ce340 100644
--- a/com32/modules/mboot.c
+++ b/com32/modules/mboot.c
@@ -835,7 +835,7 @@ static void trampoline_start(section_t *secs, int sec_count,
/* asm bzero() code from com32/lib/memset.c */
char *q = (char *) secs[i].dest;
size_t nl = secs[i].size >> 2;
- asm volatile("cld ; rep ; stosl ; movl %3,%0 ; rep ; stosb"
+ asm volatile("rep ; stosl ; movl %3,%0 ; rep ; stosb"
: "+c" (nl), "+D" (q)
: "a" (0x0U), "r" (secs[i].size & 3));
} else {
@@ -844,12 +844,12 @@ static void trampoline_start(section_t *secs, int sec_count,
char *q = (char *) secs[i].dest;
size_t n = secs[i].size;
if ( q < p ) {
- asm volatile("cld ; rep ; movsb"
+ asm volatile("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));
}
}