VirtualBox

Changeset 7637 in vbox


Ignore:
Timestamp:
Mar 28, 2008 6:48:06 PM (17 years ago)
Author:
vboxsync
Message:

cmpxchgl may change eax on failure, so tell the compiler that it output as well as input. (This was the cause of the ATA thread problems (exited because of timeout from rtSemEventWait).)

File:
1 edited

Legend:

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

    r7633 r7637  
    21972197DECLASM(bool) ASMAtomicCmpXchgU32(volatile uint32_t *pu32, const uint32_t u32New, const uint32_t u32Old);
    21982198#else
    2199 DECLINLINE(bool) ASMAtomicCmpXchgU32(volatile uint32_t *pu32, const uint32_t u32New, const uint32_t u32Old)
     2199DECLINLINE(bool) ASMAtomicCmpXchgU32(volatile uint32_t *pu32, const uint32_t u32New, uint32_t u32Old)
    22002200{
    22012201# if RT_INLINE_ASM_GNU_STYLE
    22022202    uint8_t u8Ret;
    2203     __asm__ __volatile__("lock; cmpxchgl %2, %0\n\t"
     2203    __asm__ __volatile__("lock; cmpxchgl %3, %0\n\t"
    22042204                         "setz  %1\n\t"
    22052205                         : "=m" (*pu32),
    2206                            "=qm" (u8Ret)
     2206                           "=qm" (u8Ret),
     2207                           "=a" (u32Old)
    22072208                         : "r" (u32New),
    2208                            "a" (u32Old));
     2209                           "2" (u32Old));
    22092210    return (bool)u8Ret;
    22102211
Note: See TracChangeset for help on using the changeset viewer.

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