https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ec7d874c183a9c5215e99…
commit ec7d874c183a9c5215e9906ca2cb79fc5ae6981b
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Thu Jan 28 22:03:08 2021 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu Jan 28 23:10:01 2021 +0100
[FREELDR/x64] Merge x64 and x86 versions, to fix compilation with GAS x64
Upper bits of rcx are already checked to be 0. So, we can only take care of lower bits.
This also generates smaller code.
---
boot/freeldr/freeldr/arch/amd64/linux.S | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/boot/freeldr/freeldr/arch/amd64/linux.S b/boot/freeldr/freeldr/arch/amd64/linux.S
index 383111ae66c..55d623bbb79 100644
--- a/boot/freeldr/freeldr/arch/amd64/linux.S
+++ b/boot/freeldr/freeldr/arch/amd64/linux.S
@@ -119,12 +119,12 @@ reloc_down:
#if 0
rep movsb
#else
- mov rdx, rcx // Copy the total number of bytes in EDX
- and rdx, HEX(0FFFFFFFC) // Number of bytes we copy using DWORDs
- xor rdx, rcx // Number of remaining bytes to copy after the DWORDs
- shr rcx, 2 // Count number of DWORDs
+ mov edx, ecx // Copy the total number of bytes in EDX
+ and edx, HEX(0FFFFFFFC) // Number of bytes we copy using DWORDs
+ xor edx, ecx // Number of remaining bytes to copy after the DWORDs
+ shr ecx, 2 // Count number of DWORDs
rep movsd // Move DWORDs
- mov rcx, rdx // Count number of remaining bytes
+ mov ecx, edx // Count number of remaining bytes
rep movsb // Move bytes
#endif
jmp after_reloc