mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
AK: Fix bug in MMX memcpy() unaligned prologue handling.
This commit is contained in:
parent
7ce15f1c54
commit
27df572381
1 changed files with 3 additions and 2 deletions
|
@ -12,12 +12,13 @@ void* mmx_memcpy(void* dest, const void* src, size_t len)
|
||||||
|
|
||||||
if ((dword)dest_ptr & 7) {
|
if ((dword)dest_ptr & 7) {
|
||||||
dword prologue = 8 - ((dword)dest_ptr & 7);
|
dword prologue = 8 - ((dword)dest_ptr & 7);
|
||||||
|
len -= prologue;
|
||||||
asm volatile(
|
asm volatile(
|
||||||
"rep movsb\n"
|
"rep movsb\n"
|
||||||
:: "S"(src_ptr), "D"(dest_ptr), "c"(prologue)
|
: "=S"(src_ptr), "=D"(dest_ptr), "=c"(prologue)
|
||||||
|
: "0"(src_ptr), "1"(dest_ptr), "2"(prologue)
|
||||||
: "memory"
|
: "memory"
|
||||||
);
|
);
|
||||||
len -= prologue;
|
|
||||||
}
|
}
|
||||||
for (dword i = len / 64; i; --i) {
|
for (dword i = len / 64; i; --i) {
|
||||||
asm volatile(
|
asm volatile(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue