Merge 5.5.6-rc to the main tree.

This commit is contained in:
Joerg Bruehe 2010-09-19 22:01:12 +02:00
commit f4444c0016
2 changed files with 22 additions and 8 deletions

View file

@ -111,9 +111,9 @@
On some platforms (e.g. Mac OS X and Solaris) the ebx register
is held as a pointer to the global offset table. Thus we're not
allowed to use the b-register on those platforms when compiling
PIC code, to avoid this we push ebx and pop ebx and add a movl
instruction to avoid having ebx in the interface of the assembler
instruction.
PIC code, to avoid this we push ebx and pop ebx. The new value
is copied directly from memory to avoid problems with a implicit
manipulation of the stack pointer by the push.
cmpxchg8b works on both 32-bit platforms and 64-bit platforms but
the code here is only used on 32-bit platforms, on 64-bit
@ -121,11 +121,13 @@
fine.
*/
#define make_atomic_cas_body64 \
int32 ebx=(set & 0xFFFFFFFF), ecx=(set >> 32); \
asm volatile ("push %%ebx; movl %3, %%ebx;" \
LOCK_prefix "; cmpxchg8b %0; setz %2; pop %%ebx" \
: "=m" (*a), "+A" (*cmp), "=c" (ret) \
: "m" (ebx), "c" (ecx), "m" (*a) \
asm volatile ("push %%ebx;" \
"movl (%%ecx), %%ebx;" \
"movl 4(%%ecx), %%ecx;" \
LOCK_prefix "; cmpxchg8b %0;" \
"setz %2; pop %%ebx" \
: "=m" (*a), "+A" (*cmp), "=c" (ret) \
: "c" (&set), "m" (*a) \
: "memory", "esp")
#endif