VirtualBox

Changeset 6646 in vbox for trunk/include


Ignore:
Timestamp:
Jan 31, 2008 10:22:24 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27712
Message:

Attempt to fix ASMAtomicCmpXchgExU64 with 32bit gcc. It compiles, but
produces testcase errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r6644 r6646  
    26052605#  endif
    26062606# else /* !RT_ARCH_AMD64 */
    2607     uint32_t u32Ret;
    26082607#  if RT_INLINE_ASM_GNU_STYLE
    26092608    uint64_t u64Ret;
    26102609#   if defined(PIC) || defined(RT_OS_DARWIN) /* darwin: 4.0.1 compiler option / bug? */
    2611     __asm__ __volatile__("xchgl %%ebx, %2\n\t"
    2612                          "lock; cmpxchg8b %1\n\t"
    2613                          "xchgl %%ebx, %2\n\t"
    2614                          : "=A" (u64Ret),
    2615                            "=m" (*pu64)
    2616                          : "DS" (u64New & 0xffffffff),
    2617                            "c" (u64New >> 32),
     2610    __asm__ __volatile__("xchgl %%ebx, %1\n\t"
     2611                         "lock; cmpxchg8b %3\n\t"
     2612                         "xchgl %%ebx, %1\n\t"
     2613                         : "=A" (u64Ret)
     2614                         : "DS" ((uint32_t)u64New),
     2615                           "c" ((uint32_t)(u64New >> 32)),
    26182616                           "m" (*pu64),
    2619                            "a" (u64Old & 0xffffffff),
    2620                            "d" (u64Old >> 32) );
     2617                           "0" (u64Old)
     2618                         : "memory" );
    26212619#   else /* !PIC */
    26222620    __asm__ __volatile__("lock; cmpxchg8b %3\n\t"
    2623                          : "=A" (u64Ret),
    2624                            "=m" (*pu64)
    2625                          : "b" (u64New & 0xffffffff),
    2626                            "c" (u64New >> 32),
     2621                         : "=A" (u64Ret)
     2622                         : "b" ((uint32_t)u64New),
     2623                           "c" ((uint32_t)(u64New >> 32)),
    26272624                           "m" (*pu64),
    2628                            "a" (u64Old & 0xffffffff),
    2629                            "d" (u64Old >> 32) );
     2625                           "0" (u64Old)
     2626                         : "memory" );
    26302627#   endif
    26312628    *pu64Old = u64Ret;
    26322629    return u64Ret != u64Old;
    26332630#  else
     2631    uint32_t u32Ret;
    26342632    __asm
    26352633    {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette