hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cf_atomic.h File Reference
#include <stdint.h>
Include dependency graph for cf_atomic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MARCH_i686   1
#define SIZEOF_ATOMIC_INT   4
#define HAS_ATOMIC_32   1
#define cf_atomic32_get(a)   (a)
#define cf_atomic32_set(a, b)   (*(a) = (b))
#define cf_atomic32_sub(a, b)   (cf_atomic32_add((a), (0 - (b))))
#define cf_atomic32_incr(a)   (cf_atomic32_add((a), 1))
#define cf_atomic32_decr(a)   (cf_atomic32_add((a), -1))
#define cf_atomic32_cas_m(_a, _b, _x)
#define cf_atomic32_fas_m(_a, _b)
#define cf_atomic_p_get(_a)   cf_atomic32_get(_a)
#define cf_atomic_p_set(_a, _b)   cf_atomic32_set(_a, _b)
#define cf_atomic_p_add(_a, _b)   cf_atomic32_add(_a, _b)
#define cf_atomic_p_incr(_a)   cf_atomic32_add((_a), 1)
#define cf_atomic_p_decr(_a)   cf_atomic32_add((_a), -1)
#define cf_atomic_p_cas(_a, _b, _x)   cf_atomic32_cas(_a, _b, _x)
#define cf_atomic_p_cas_m(_a, _b, _x)   cf_atomic32_cas_m(_a, _b, _x)
#define cf_atomic_p_fas(_a, _b)   cf_atomic32_fas(_a, _b)
#define cf_atomic_p_fas_m(_a, _b)   cf_atomic32_fas_m(_a, _b)
#define cf_atomic_p_addunless(_a, _b, _x)   cf_atomic32_addunless(_a, _b, _x)
#define cf_atomic_int_get(_a)   cf_atomic32_get(_a)
#define cf_atomic_int_set(_a, _b)   cf_atomic32_set(_a, _b)
#define cf_atomic_int_add(_a, _b)   cf_atomic32_add(_a, _b)
#define cf_atomic_int_sub(_a, _b)   cf_atomic32_sub(_a, _b)
#define cf_atomic_int_incr(_a)   cf_atomic32_add((_a), 1)
#define cf_atomic_int_decr(_a)   cf_atomic32_add((_a), -1)
#define cf_atomic_int_cas(_a, _b, _x)   cf_atomic32_cas(_a, _b, _x)
#define cf_atomic_int_cas_m(_a, _b, _x)   cf_atomic32_cas_m(_a, _b, _x)
#define cf_atomic_int_fas(_a, _b)   cf_atomic32_fas(_a, _b)
#define cf_atomic_int_fas_m(_a, _b)   cf_atomic32_fas_m(_a, _b)
#define cf_atomic_int_addunless(_a, _b, _x)   cf_atomic32_addunless(_a, _b, _x)
#define smb_mb()   asm volatile("mfence":::"memory")
#define CF_MEMORY_BARRIER()   __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")
#define CF_MEMORY_BARRIER_READ()   CF_MEMORY_BARRIER()
#define CF_MEMORY_BARRIER_WRITE()   __asm__ __volatile__ ("" : : : "memory")

Typedefs

typedef volatile uint32_t cf_atomic32
typedef volatile uint32_t cf_atomic_p
typedef volatile uint32_t cf_atomic_int
typedef uint32_t cf_atomic_int_t

Macro Definition Documentation

#define cf_atomic32_cas_m (   _a,
  _b,
  _x 
)
Value:
({ __typeof__(_b) __b = _b; \
__asm__ __volatile__ ("lock; cmpxchg %1,%2" : "=a"(__b) : "q"(_x), "m"(*(_a)), "0"(_b) : "memory"); \
__b; \
})

Definition at line 216 of file cf_atomic.h.

#define cf_atomic32_decr (   a)    (cf_atomic32_add((a), -1))

Definition at line 198 of file cf_atomic.h.

#define cf_atomic32_fas_m (   _a,
  _b 
)
Value:
({ __typeof__(_b) __b; \
__asm__ __volatile__ ("lock; xchg %0,%1" : "=r"(__b) : "m"(*(_a)), "0"(_b)); \
__b; \
})

Definition at line 235 of file cf_atomic.h.

#define cf_atomic32_get (   a)    (a)

Definition at line 180 of file cf_atomic.h.

#define cf_atomic32_incr (   a)    (cf_atomic32_add((a), 1))

Definition at line 197 of file cf_atomic.h.

#define cf_atomic32_set (   a,
 
)    (*(a) = (b))

Definition at line 181 of file cf_atomic.h.

#define cf_atomic32_sub (   a,
 
)    (cf_atomic32_add((a), (0 - (b))))

Definition at line 196 of file cf_atomic.h.

#define cf_atomic_int_add (   _a,
  _b 
)    cf_atomic32_add(_a, _b)

Definition at line 291 of file cf_atomic.h.

#define cf_atomic_int_addunless (   _a,
  _b,
  _x 
)    cf_atomic32_addunless(_a, _b, _x)

Definition at line 301 of file cf_atomic.h.

#define cf_atomic_int_cas (   _a,
  _b,
  _x 
)    cf_atomic32_cas(_a, _b, _x)

Definition at line 297 of file cf_atomic.h.

#define cf_atomic_int_cas_m (   _a,
  _b,
  _x 
)    cf_atomic32_cas_m(_a, _b, _x)

Definition at line 298 of file cf_atomic.h.

#define cf_atomic_int_decr (   _a)    cf_atomic32_add((_a), -1)

Definition at line 294 of file cf_atomic.h.

#define cf_atomic_int_fas (   _a,
  _b 
)    cf_atomic32_fas(_a, _b)

Definition at line 299 of file cf_atomic.h.

#define cf_atomic_int_fas_m (   _a,
  _b 
)    cf_atomic32_fas_m(_a, _b)

Definition at line 300 of file cf_atomic.h.

#define cf_atomic_int_get (   _a)    cf_atomic32_get(_a)

Definition at line 289 of file cf_atomic.h.

#define cf_atomic_int_incr (   _a)    cf_atomic32_add((_a), 1)

Definition at line 293 of file cf_atomic.h.

#define cf_atomic_int_set (   _a,
  _b 
)    cf_atomic32_set(_a, _b)

Definition at line 290 of file cf_atomic.h.

#define cf_atomic_int_sub (   _a,
  _b 
)    cf_atomic32_sub(_a, _b)

Definition at line 292 of file cf_atomic.h.

#define cf_atomic_p_add (   _a,
  _b 
)    cf_atomic32_add(_a, _b)

Definition at line 277 of file cf_atomic.h.

#define cf_atomic_p_addunless (   _a,
  _b,
  _x 
)    cf_atomic32_addunless(_a, _b, _x)

Definition at line 286 of file cf_atomic.h.

#define cf_atomic_p_cas (   _a,
  _b,
  _x 
)    cf_atomic32_cas(_a, _b, _x)

Definition at line 282 of file cf_atomic.h.

#define cf_atomic_p_cas_m (   _a,
  _b,
  _x 
)    cf_atomic32_cas_m(_a, _b, _x)

Definition at line 283 of file cf_atomic.h.

#define cf_atomic_p_decr (   _a)    cf_atomic32_add((_a), -1)

Definition at line 279 of file cf_atomic.h.

#define cf_atomic_p_fas (   _a,
  _b 
)    cf_atomic32_fas(_a, _b)

Definition at line 284 of file cf_atomic.h.

#define cf_atomic_p_fas_m (   _a,
  _b 
)    cf_atomic32_fas_m(_a, _b)

Definition at line 285 of file cf_atomic.h.

#define cf_atomic_p_get (   _a)    cf_atomic32_get(_a)

Definition at line 275 of file cf_atomic.h.

#define cf_atomic_p_incr (   _a)    cf_atomic32_add((_a), 1)

Definition at line 278 of file cf_atomic.h.

#define cf_atomic_p_set (   _a,
  _b 
)    cf_atomic32_set(_a, _b)

Definition at line 276 of file cf_atomic.h.

#define CF_MEMORY_BARRIER ( )    __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory")

Definition at line 357 of file cf_atomic.h.

#define CF_MEMORY_BARRIER_READ ( )    CF_MEMORY_BARRIER()

Definition at line 361 of file cf_atomic.h.

#define CF_MEMORY_BARRIER_WRITE ( )    __asm__ __volatile__ ("" : : : "memory")

Definition at line 365 of file cf_atomic.h.

#define HAS_ATOMIC_32   1

Definition at line 44 of file cf_atomic.h.

#define MARCH_i686   1

Definition at line 27 of file cf_atomic.h.

#define SIZEOF_ATOMIC_INT   4

Definition at line 42 of file cf_atomic.h.

#define smb_mb ( )    asm volatile("mfence":::"memory")

Definition at line 347 of file cf_atomic.h.

Typedef Documentation

typedef volatile uint32_t cf_atomic32

Definition at line 39 of file cf_atomic.h.

typedef volatile uint32_t cf_atomic_int

Definition at line 41 of file cf_atomic.h.

typedef uint32_t cf_atomic_int_t

Definition at line 43 of file cf_atomic.h.

typedef volatile uint32_t cf_atomic_p

Definition at line 40 of file cf_atomic.h.