Back to index

glibc  2.9
Defines | Typedefs
atomic.h File Reference
#include <stdint.h>
#include <ia64intrin.h>

Go to the source code of this file.

Defines

#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval)   (abort (), 0)
#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval)   (abort (), 0)
#define __arch_compare_and_exchange_bool_32_acq(mem, newval, oldval)
#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval)
#define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval)   (abort (), (__typeof (*mem)) 0)
#define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval)   (abort (), (__typeof (*mem)) 0)
#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval)
#define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval)   __sync_val_compare_and_swap ((mem), (long) (oldval), (long) (newval))
#define atomic_exchange_acq(mem, value)   __sync_lock_test_and_set (mem, value)
#define atomic_exchange_rel(mem, value)   (__sync_synchronize (), __sync_lock_test_and_set (mem, value))
#define atomic_exchange_and_add(mem, value)
#define atomic_decrement_if_positive(mem)
#define atomic_bit_test_set(mem, bit)
#define atomic_full_barrier()   __sync_synchronize ()

Typedefs

typedef int8_t atomic8_t
typedef uint8_t uatomic8_t
typedef int_fast8_t atomic_fast8_t
typedef uint_fast8_t uatomic_fast8_t
typedef int16_t atomic16_t
typedef uint16_t uatomic16_t
typedef int_fast16_t atomic_fast16_t
typedef uint_fast16_t uatomic_fast16_t
typedef int32_t atomic32_t
typedef uint32_t uatomic32_t
typedef int_fast32_t atomic_fast32_t
typedef uint_fast32_t uatomic_fast32_t
typedef int64_t atomic64_t
typedef uint64_t uatomic64_t
typedef int_fast64_t atomic_fast64_t
typedef uint_fast64_t uatomic_fast64_t
typedef intptr_t atomicptr_t
typedef uintptr_t uatomicptr_t
typedef intmax_t atomic_max_t
typedef uintmax_t uatomic_max_t

Define Documentation

#define __arch_compare_and_exchange_bool_16_acq (   mem,
  newval,
  oldval 
)    (abort (), 0)

Definition at line 51 of file atomic.h.

#define __arch_compare_and_exchange_bool_32_acq (   mem,
  newval,
  oldval 
)
Value:
(!__sync_bool_compare_and_swap ((mem), (int) (long) (oldval), \
                              (int) (long) (newval)))

Definition at line 54 of file atomic.h.

#define __arch_compare_and_exchange_bool_64_acq (   mem,
  newval,
  oldval 
)
Value:
(!__sync_bool_compare_and_swap ((mem), (long) (oldval), \
                              (long) (newval)))

Definition at line 58 of file atomic.h.

#define __arch_compare_and_exchange_bool_8_acq (   mem,
  newval,
  oldval 
)    (abort (), 0)

Definition at line 48 of file atomic.h.

#define __arch_compare_and_exchange_val_16_acq (   mem,
  newval,
  oldval 
)    (abort (), (__typeof (*mem)) 0)

Definition at line 65 of file atomic.h.

#define __arch_compare_and_exchange_val_32_acq (   mem,
  newval,
  oldval 
)
Value:
__sync_val_compare_and_swap ((mem), (int) (long) (oldval), \
                            (int) (long) (newval))

Definition at line 68 of file atomic.h.

#define __arch_compare_and_exchange_val_64_acq (   mem,
  newval,
  oldval 
)    __sync_val_compare_and_swap ((mem), (long) (oldval), (long) (newval))

Definition at line 72 of file atomic.h.

#define __arch_compare_and_exchange_val_8_acq (   mem,
  newval,
  oldval 
)    (abort (), (__typeof (*mem)) 0)

Definition at line 62 of file atomic.h.

#define atomic_bit_test_set (   mem,
  bit 
)
Value:
({ __typeof (*mem) __oldval, __val;                                         \
     __typeof (mem) __memp = (mem);                                         \
     __typeof (*mem) __mask = ((__typeof (*mem)) 1 << (bit));               \
                                                                     \
     __val = (*__memp);                                                     \
     do                                                                     \
       {                                                             \
        __oldval = __val;                                            \
        __val = atomic_compare_and_exchange_val_acq (__memp,                \
                                                __oldval | __mask,      \
                                                __oldval);           \
       }                                                             \
     while (__builtin_expect (__val != __oldval, 0));                       \
     __oldval & __mask; })

Definition at line 103 of file atomic.h.

Value:
({ __typeof (*mem) __oldval, __val;                                         \
     __typeof (mem) __memp = (mem);                                         \
                                                                     \
     __val = (*__memp);                                                     \
     do                                                                     \
       {                                                             \
        __oldval = __val;                                            \
        if (__builtin_expect (__val <= 0, 0))                               \
          break;                                                     \
        __val = atomic_compare_and_exchange_val_acq (__memp,   __oldval - 1, \
                                                __oldval);           \
       }                                                             \
     while (__builtin_expect (__val != __oldval, 0));                       \
     __oldval; })

Definition at line 87 of file atomic.h.

#define atomic_exchange_acq (   mem,
  value 
)    __sync_lock_test_and_set (mem, value)

Definition at line 76 of file atomic.h.

#define atomic_exchange_and_add (   mem,
  value 
)
Value:
({ __typeof (*mem) __result;                                                \
     __result = __sync_fetch_and_add ((mem), (int) (value));                \
     __result; })

Definition at line 82 of file atomic.h.

#define atomic_exchange_rel (   mem,
  value 
)    (__sync_synchronize (), __sync_lock_test_and_set (mem, value))

Definition at line 79 of file atomic.h.

#define atomic_full_barrier ( )    __sync_synchronize ()

Definition at line 119 of file atomic.h.


Typedef Documentation

Definition at line 27 of file atomic.h.

Definition at line 32 of file atomic.h.

Definition at line 37 of file atomic.h.

typedef int8_t atomic8_t

Definition at line 22 of file atomic.h.

Definition at line 29 of file atomic.h.

Definition at line 34 of file atomic.h.

Definition at line 39 of file atomic.h.

Definition at line 24 of file atomic.h.

Definition at line 44 of file atomic.h.

Definition at line 42 of file atomic.h.

Definition at line 28 of file atomic.h.

Definition at line 33 of file atomic.h.

Definition at line 38 of file atomic.h.

Definition at line 23 of file atomic.h.

Definition at line 30 of file atomic.h.

Definition at line 35 of file atomic.h.

Definition at line 40 of file atomic.h.

Definition at line 25 of file atomic.h.

Definition at line 45 of file atomic.h.

Definition at line 43 of file atomic.h.