Changeset a1ef4c0 in mainline for kernel/arch/amd64/include/atomic.h


Ignore:
Timestamp:
2012-11-22T23:35:33Z (11 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
02ee69da
Parents:
94b39ba
Message:

Fixed type mismatch in local_atomic_exchange() on amd64, ia32. Fixes build of amd64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/atomic.h

    r94b39ba ra1ef4c0  
    216216#define local_atomic_cas(pptr, exp_val, new_val) \
    217217({ \
    218         typeof(*(pptr)) old_val; \
    219         _atomic_cas_impl(pptr, exp_val, new_val, old_val, ""); \
     218        /* Use proper types and avoid name clashes */ \
     219        typeof(*(pptr)) _old_val_cas; \
     220        typeof(*(pptr)) _exp_val_cas = exp_val; \
     221        typeof(*(pptr)) _new_val_cas = new_val; \
     222        _atomic_cas_impl(pptr, _exp_val_cas, _new_val_cas, _old_val_cas, ""); \
    220223        \
    221         old_val; \
     224        _old_val_cas; \
    222225})
    223226
     
    236239#define local_atomic_exchange(pptr, new_val) \
    237240({ \
    238         typeof(*(pptr)) exp_val; \
    239         typeof(*(pptr)) old_val; \
     241        /* Use proper types and avoid name clashes */ \
     242        typeof(*(pptr)) _exp_val_x; \
     243        typeof(*(pptr)) _old_val_x; \
     244        typeof(*(pptr)) _new_val_x = new_val; \
    240245        \
    241246        do { \
    242                 exp_val = *pptr; \
    243                 old_val = local_atomic_cas(pptr, exp_val, new_val); \
    244         } while (old_val != exp_val); \
     247                _exp_val_x = *pptr; \
     248                _old_val_x = local_atomic_cas(pptr, _exp_val_x, _new_val_x); \
     249        } while (_old_val_x != _exp_val_x); \
    245250        \
    246         old_val; \
     251        _old_val_x; \
    247252})
    248253
Note: See TracChangeset for help on using the changeset viewer.