3 AO_t new_val1, AO_t new_val2)
6 - __asm__ __volatile__("lock; cmpxchg8b %0; setz %1"
7 : "=m"(*addr), "=q"(result)
8 - : "m"(*addr), "d" (old_val1), "a" (old_val2),
9 - "c" (new_val1), "b" (new_val2) : "memory");
14 AO_t new_val1, AO_t new_val2)
18 + /* If PIC is turned on, we can't use %ebx as it is reserved for the
19 + GOT poiner. We can save and restore %ebx because GCC won't be
20 + using it for anything else (such as any of the m operands) */
21 + __asm__ __volatile__("pushl %%ebx;" /* save ebx used for PIC GOT ptr */
22 + "movl %6,%%ebx;" /* move new_val2 to %ebx */
23 + "lock; cmpxchg8b %0; setz %1;"
24 + "pop %%ebx;" /* restore %ebx */
25 : "=m"(*addr), "=q"(result)
26 + : "m"(*addr), "d" (old_val2), "a" (old_val1),
27 + "c" (new_val2), "m" (new_val1) : "memory");
29 + /* We can't just do the same thing in non-PIC mode, because GCC
30 + * might be using %ebx as the memory operand. We could have ifdef'd
31 + * in a clobber, but there's no point doing the push/pop if we don't
33 + __asm__ __volatile__("lock; cmpxchg8b %0; setz %1;"
34 + : "=m"(*addr), "=q"(result)
35 + : "m"(*addr), "d" (old_val2), "a" (old_val1),
36 + "c" (new_val2), "b" (new_val1) : "memory");