VirtualBox

Changeset 6653 in vbox


Ignore:
Timestamp:
Jan 31, 2008 12:13:00 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27719
Message:

Yet another fix for ASMAtomicCmpXchgExU64, needed by 32bit gcc with
debug build, to prevent gcc from running out of registers.

File:
1 edited

Legend:

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

    r6651 r6653  
    26022602    uint64_t u64Ret;
    26032603#   if defined(PIC) || defined(RT_OS_DARWIN) /* darwin: 4.0.1 compiler option / bug? */
    2604     __asm__ __volatile__("xchgl %%ebx, %2\n\t"
    2605                          "lock; cmpxchg8b %4\n\t"
    2606                          "xchgl %%ebx, %2\n\t"
    2607                          : "=A" (u64Ret),
    2608                            "=m" (*pu64)
     2604    /* NB: this code uses a memory clobber description, because the clean
     2605     * solution with an output value for *pu64 makes gcc run out of registers.
     2606     * This will cause suboptimal code, and anyone with a better solution is
     2607     * welcome to improve this. */
     2608    __asm__ __volatile__("xchgl %%ebx, %1\n\t"
     2609                         "lock; cmpxchg8b %3\n\t"
     2610                         "xchgl %%ebx, %1\n\t"
     2611                         : "=A" (u64Ret)
    26092612                         : "DS" ((uint32_t)u64New),
    26102613                           "c" ((uint32_t)(u64New >> 32)),
    26112614                           "m" (*pu64),
    2612                            "0" (u64Old));
     2615                           "0" (u64Old)
     2616                         : "memory" );
    26132617#   else /* !PIC */
    26142618    __asm__ __volatile__("lock; cmpxchg8b %4\n\t"
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