This patch introduces the odp_atomic_internal.h header file and changes some
lock and synchronization components to use this API instead of using GCC
__atomic builtins directly. The goal is to wrap all usage of non-standard
features (e.g. GCC builtins).

odp_atomic_internal.h reuses the 32- and 64-bit atomic types from odp_atomic.h
and adds operations which can take C11-style memory models (e.g. acquire,
release etc) as parameters. Also some basic atomic operations on pointers
(odp_atomic_ptr_t) defined. Finally the odp_atomic_flag_t type and
operations are defined, these can be used to implement e.g. spin locks
(potentially more efficient than using odp_atomic_u32_t).

Many of these atomic types and operations are be needed by the lock-less
timer implementation but also by other ODP components in progress.

Ola Liljedahl (4):
  linux-generic: odp_atomic_internal.h: C11-style 32/64-bit/pointer/flag
    atomics
  linux-generic: odp_barrier.h: use odp_atomic_internal.h
  linux-generic: odp_rwlock[ch]: use odp_atomic_internal.h
  linux-generic: odp_spinlock[ch]: use odp_atomic_internal.h

 platform/linux-generic/include/api/odp_rwlock.h    |   4 +-
 platform/linux-generic/include/api/odp_spinlock.h  |   2 +-
 .../linux-generic/include/odp_atomic_internal.h    | 603 +++++++++++++++++++++
 platform/linux-generic/odp_barrier.c               |   5 +-
 platform/linux-generic/odp_rwlock.c                |  35 +-
 platform/linux-generic/odp_spinlock.c              |  17 +-
 6 files changed, 638 insertions(+), 28 deletions(-)
 create mode 100644 platform/linux-generic/include/odp_atomic_internal.h

-- 
1.9.1


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to