Some of these changes (e.g. use of GCC __atomic builtins) are in preparation
for the appearance of odp_atomic_internal.h but these patches can be merged
separately.

odp_atomic.h:
Use struct for 32- and 64-bit atomic types, this prevents non-atomic access
to atomic variables and enables additional fields as possibly required by
some implementations.
Use GCC __atomic builtins with relaxed memory model (previously __sync
builtins).
Made some 64-bit operations (e.g. load, store) atomic on 32-bit architectures.
Emulated 64-bit atomic support for functionally challenged 32-bit architectures
(e.g. PPC32).
Relaxed memory model for atomic operations, this enhances performance on
weakly ordered architectures (e.g. most RISC).
Added missing atomic_add_u32, atomic_sub_u32 and atomic_sub_64 operations.
Removed 32- and 64-bit cmpset operations (to be reintroduced in
odp_atomic_intermal.h).

odp_generator.c:
Updated to use odp_atomic.h operations with atomic types.

odp_barrier.h:
Minor function signature change (int -> uint32_t).

odp_spin_internal.h:
Removed odp_mem_barrier() which is a compiler only barrier and basically
useless and dangerous on all weakly ordered architectures. It was only used
by odp_ring.c.

odp_barrier.c:
Updated to use odp_atomic.h typese and functions. Fixed broken (non-atomic)
wrap-around of 'bar'.

odp_buffer.c:
Updated to use odp_atomic.h functions (ref_count).

odp_ring.c:
Added missing release barriers. Updated to use GCC __atomic cmpset facility
(tmp fix).

odp_rwlock.c:
Updated to use odp_atomic.h. Updated to use GCC __atomic facilities (tmp
fix).

odp_ticketlock.c:
Updated to use odp_atomic.h. Updated to use GCC __atomic facilities (tmp
fix). Fixed missing barrier in ticketlock_lock().

odp_atomic_test.c:
Update to conform to latest odp_atomic.h syntax. Added usage of odp_barrier_t
instead of home grown thread barrier.

Ola Liljedahl (7):
  api: odp_atomic.h: use struct type, relaxed implem, missing funcs
  api: odp_barrier.h: signature change, use odp_atomic.h, atomic
    wrap-around fix
  linux-generic: odp_ring.c: use __atomic cmpset, added missing
    barriers, removed dangerous odp_mem_barrier
  linux-generic: odp_ticketlock.c: use odp_atomic.h and __atomic (tmp),
    added missing barrier
  linux-generic: odp_rwlock.c: use odp_atomic.h and GCC __atomic (tmp)
  linux-generic: odp_buffer.c: use odp_atomic.h
  example: odp_generator.c: use odp_atomic.h

 example/generator/odp_generator.c                  |  28 ++-
 platform/linux-generic/include/api/odp_atomic.h    | 269 +++++++++++++--------
 platform/linux-generic/include/api/odp_barrier.h   |   2 +-
 platform/linux-generic/include/odp_spin_internal.h |   9 -
 platform/linux-generic/odp_barrier.c               |  17 +-
 platform/linux-generic/odp_buffer.c                |   3 +-
 platform/linux-generic/odp_ring.c                  |  28 ++-
 platform/linux-generic/odp_rwlock.c                |  24 +-
 platform/linux-generic/odp_ticketlock.c            |  12 +-
 test/api_test/odp_atomic_test.c                    |  31 +--
 10 files changed, 253 insertions(+), 170 deletions(-)

-- 
1.9.1


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to