[Pkg-libatomic-ops-commits] r8 - in trunk/debian: . patches
ianw at alioth.debian.org
ianw at alioth.debian.org
Fri Feb 1 08:32:58 UTC 2008
Author: ianw
Date: 2008-02-01 08:32:57 +0000 (Fri, 01 Feb 2008)
New Revision: 8
Modified:
trunk/debian/changelog
trunk/debian/patches/07_pic_cmpxchng.patch
Log:
real fix
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2008-02-01 01:35:28 UTC (rev 7)
+++ trunk/debian/changelog 2008-02-01 08:32:57 UTC (rev 8)
@@ -3,7 +3,8 @@
* Closes: #463390 -- Add 06_double.patch to fix some issues with double
CAS defs. Patch by Jamey Sharp, thanks Jamey!
* This fixed up AO_compare_double_and_swap_double_full which then
- revealed a PIC problem, fixed in 07_pic_cmpxchng.patch
+ revealed a PIC problem, which then revealed the arguments to cmpxchg8b
+ were around the wrong way, fixed in 07_pic_cmpxchng.patch
-- Ian Wienand <ianw at debian.org> Fri, 01 Feb 2008 11:09:33 +1100
Modified: trunk/debian/patches/07_pic_cmpxchng.patch
===================================================================
--- trunk/debian/patches/07_pic_cmpxchng.patch 2008-02-01 01:35:28 UTC (rev 7)
+++ trunk/debian/patches/07_pic_cmpxchng.patch 2008-02-01 08:32:57 UTC (rev 8)
@@ -1,11 +1,12 @@
-cmpxchng8b use ebx which we can't touch in PIC mode.
+cmpxchng8b use ebx which we can't touch in PIC mode. Also, the arguments
+to cmpxchg8b are a bit funny and were around the wrong way
-Write a version that saves and restores
+Write a version that saves and restores and fix up the arguments
Ian Wienand <ianw at ieee.org>
---- libatomic-ops-1.2/src/atomic_ops/sysdeps/gcc/x86.h 2008-02-01 12:26:39.000000000 +1100
-+++ libatomic-ops-1.2-new/src/atomic_ops/sysdeps/gcc/x86.h 2008-02-01 12:24:21.000000000 +1100
+--- libatomic-ops-1.2/src/atomic_ops/sysdeps/gcc/x86.h 2008-02-01 19:29:35.000000000 +1100
++++ libatomic-ops-1.2-new-2/src/atomic_ops/sysdeps/gcc/x86.h 2008-02-01 19:27:41.000000000 +1100
@@ -141,10 +141,27 @@
AO_t new_val1, AO_t new_val2)
{
@@ -19,18 +20,20 @@
+ "movl %6,%%ebx;" /* move new_val2 to %ebx */
+ "lock; cmpxchg8b %0; setz %1;"
+ "pop %%ebx;" /* restore %ebx */
-+ : "=m"(*addr), "=q"(result)
-+ : "m"(*addr), "d" (old_val1), "a" (old_val2),
-+ "c" (new_val1), "m" (new_val2) : "memory");
+ : "=m"(*addr), "=q"(result)
+- : "m"(*addr), "d" (old_val1), "a" (old_val2),
+- "c" (new_val1), "b" (new_val2) : "memory");
++ : "m"(*addr), "d" (old_val2), "a" (old_val1),
++ "c" (new_val2), "m" (new_val1) : "memory");
+ #else
+ /* We can't just do the same thing in non-PIC mode, because GCC
+ * might be using %ebx as the memory operand. We could have ifdef'd
+ * in a clobber, but there's no point doing the push/pop if we don't
+ * have to. */
+ __asm__ __volatile__("lock; cmpxchg8b %0; setz %1;"
- : "=m"(*addr), "=q"(result)
- : "m"(*addr), "d" (old_val1), "a" (old_val2),
- "c" (new_val1), "b" (new_val2) : "memory");
++ : "=m"(*addr), "=q"(result)
++ : "m"(*addr), "d" (old_val2), "a" (old_val1),
++ "c" (new_val2), "b" (new_val1) : "memory");
+ #endif
return (int) result;
}
More information about the Pkg-libatomic-ops-commits
mailing list