// Restore %ds (from %ss)
" movw %%ss, %%ax\n"
" movw %%ax, %%ds\n"
- : "+c"(count), "+S"(si)
- : : "eax", "di", "cc"); // XXX - also clobbers %es
+ : "+c"(count), "+S"(si), "+m" (__segment_ES)
+ : : "eax", "di", "cc");
set_a20(prev_a20_enable);
" movw %%ax, %%ds\n"
" movw %%ax, %%ss\n"
:
- : "S"(gdt_far)
+ : "S"(gdt_far), "m" (__segment_ES)
: "eax", "cc");
}
asm volatile(
"rep stosb %%es:(%%di)"
: "+c"(len), "+D"(d_far)
- : "a"(c)
+ : "a"(c), "m" (__segment_ES)
: "cc", "memory");
}
asm volatile(
"rep stosw %%es:(%%di)"
: "+c"(len), "+D"(d_far)
- : "a"(c)
+ : "a"(c), "m" (__segment_ES)
: "cc", "memory");
}
"rep movsb (%%si),%%es:(%%di)\n"
"movw %w0, %%ds"
: "=&r"(bkup_ds), "+c"(len), "+S"(s_far), "+D"(d_far)
- : "r"(s_seg)
+ : "r"(s_seg), "m" (__segment_ES)
: "cc", "memory");
}
asm volatile(
"rep movsb (%%esi),%%es:(%%edi)"
: "+c"(len), "+S"(s1), "+D"(d)
- : : "cc", "memory");
+ : "m" (__segment_ES) : "cc", "memory");
return d1;
}
// Common case - use 4-byte copy
asm volatile(
"rep movsl (%%esi),%%es:(%%edi)"
: "+c"(len), "+S"(s1), "+D"(d)
- : : "cc", "memory");
+ : "m" (__segment_ES) : "cc", "memory");
return d1;
}
void
iomemcpy(void *d, const void *s, u32 len)
{
+ ASSERT32FLAT();
yield();
while (len > 3) {
u32 copylen = len;