[ros-dev] cmpxchg8b

Ge van Geldorp gvg at reactos.org
Mon Jan 9 10:49:40 CET 2006


It seems the old binutils versions don't have a problem with "cmpxchg8b" but
with "qword ptr". The patch below makes the code compile on older versions
again. Any objections to committing it?

I've created a bug 1264 for keeping track of the "no longer works on i486"
issue.

GvG

Index: ntoskrnl/ex/i386/fastinterlck_asm.S
===================================================================
--- ntoskrnl/ex/i386/fastinterlck_asm.S	(revision 20747)
+++ ntoskrnl/ex/i386/fastinterlck_asm.S	(working copy)
@@ -405,7 +405,7 @@
 
     /* Get next pointer and do the exchange */
     mov ebx, [eax]
-    LOCK cmpxchg8b qword ptr [ebp]
+    LOCK cmpxchg8b [ebp]
     jnz 1b
 
     /* Restore registers and return */
@@ -449,7 +449,7 @@
     lea ecx, [edx+0x10001]
 
     /* Do the exchange */
-    LOCK cmpxchg8b qword ptr [ebp]
+    LOCK cmpxchg8b [ebp]
     jnz 1b
 
     /* Restore registers and return */
@@ -489,7 +489,7 @@
     mov cx, bx
 
     /* Do the exchange */
-    LOCK cmpxchg8b qword ptr [ebp]
+    LOCK cmpxchg8b [ebp]
     jnz 1b
 
     /* Restore registers and return */
@@ -623,7 +623,7 @@
     mov edx, [edx+4]
 
     /* Do the op */
-    LOCK cmpxchg8b qword ptr [ebp]
+    LOCK cmpxchg8b [ebp]
 
     /* Restore volatiles */
     pop ebp
@@ -655,7 +655,7 @@
     mov edx, [edx+4]
 
     /* Do the op */
-    LOCK cmpxchg8b qword ptr [ebp]
+    LOCK cmpxchg8b [ebp]
 
     /* Restore volatiles */
     pop ebp



More information about the Ros-dev mailing list