This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via 2151bf694d870493846e02f5d85fbda189008259 (commit) via d5a6c1289da50b0923e5db7293d21fabb22ffeb3 (commit) via a3eae446071b31767ea8b1a27ceb412cd36ab66b (commit) via 1ed6a4fab0cc48e1d1a8978a36b84c4d5334647c (commit) via c62004cb48ab1cba876ae46d19adbf14641c8476 (commit) via 8a0b084a61b07aae811df1c4fd7eab74b52a6d75 (commit) via b39a4f517176d7f65210056026d7f7842467bb20 (commit) via 283b4a449cefcdf7a9a781b9b126a35598cc9c65 (commit) via 701f695013218b1bbaf97212bb00b708ec738819 (commit) via 2deaffd485fec676e29e379451d8f1ebdde79c54 (commit) via e2bea00c339c2aae29476b436bcd6ee3b9a51342 (commit) via ff5dd845b8ea8a3ecafeeca366b0d950d1455a25 (commit) via d82a651c0029a13c27065d57a68fd471785dc97c (commit) via d01c316a31f02155f55ea898a35381ff5060bfa9 (commit) via 0e6bdb3fd61c818aed53827e96263fd14ed6edcc (commit) via 44dc80798aa4fb92f60e1cd38f2f518b7e11946f (commit) via 309aab7862f8047e96062853729ec709bade5ed6 (commit) via 70dc2963eaf9e8dbd528607fdd08ac6204c5c13c (commit) from 3f58ed15a080a4dd9538d0a62afe8d229342249c (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 2151bf694d870493846e02f5d85fbda189008259 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:26 2016 +0200
linux-generic: adding spinlock.h
Based on API interface files.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp_drv.h b/include/odp_drv.h index 35e070c..776cf12 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -22,6 +22,7 @@ extern C { #include <odp/drv/atomic.h> #include <odp/drv/byteorder.h> #include <odp/drv/compiler.h> +#include <odp/drv/spinlock.h> #include <odp/drv/std_types.h> #include <odp/drv/sync.h>
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 109b42e..6bd95a3 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -97,13 +97,15 @@ odpdrvinclude_HEADERS = \ $(srcdir)/include/odp/drv/atomic.h \ $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h \ + $(srcdir)/include/odp/drv/spinlock.h \ $(srcdir)/include/odp/drv/std_types.h \ $(srcdir)/include/odp/drv/sync.h
odpdrvplatincludedir = $(includedir)/odp/drv/plat odpdrvplatinclude_HEADERS = \ $(srcdir)/include/odp/drv/plat/atomic_types.h \ - $(srcdir)/include/odp/drv/plat/byteorder_types.h + $(srcdir)/include/odp/drv/plat/byteorder_types.h \ + $(srcdir)/include/odp/drv/plat/spinlock_types.h
noinst_HEADERS = \ ${srcdir}/include/odp_align_internal.h \ @@ -201,6 +203,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_version.c \ odp_weak.c \ drv_atomic.c \ + drv_spinlock.c \ arch/@ARCH_DIR@/odp_cpu_arch.c \ arch/@ARCH_DIR@/odp_sysinfo_parse.c
diff --git a/platform/linux-generic/drv_spinlock.c b/platform/linux-generic/drv_spinlock.c new file mode 100644 index 0000000..69e3da7 --- /dev/null +++ b/platform/linux-generic/drv_spinlock.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/drv/spinlock.h> +#include <odp_atomic_internal.h> + +void odpdrv_spinlock_init(odpdrv_spinlock_t *spinlock) +{ + _odp_atomic_flag_init(&spinlock->lock, 0); +} + +void odpdrv_spinlock_lock(odpdrv_spinlock_t *spinlock) +{ + /* While the lock is already taken... */ + while (_odp_atomic_flag_tas(&spinlock->lock)) + /* ...spin reading the flag (relaxed MM), + * the loop will exit when the lock becomes available + * and we will retry the TAS operation above */ + while (_odp_atomic_flag_load(&spinlock->lock)) + odp_cpu_pause(); +} + +int odpdrv_spinlock_trylock(odpdrv_spinlock_t *spinlock) +{ + return (_odp_atomic_flag_tas(&spinlock->lock) == 0); +} + +void odpdrv_spinlock_unlock(odpdrv_spinlock_t *spinlock) +{ + _odp_atomic_flag_clear(&spinlock->lock); +} + +int odpdrv_spinlock_is_locked(odpdrv_spinlock_t *spinlock) +{ + return _odp_atomic_flag_load(&spinlock->lock) != 0; +} diff --git a/platform/linux-generic/include/odp/drv/plat/spinlock_types.h b/platform/linux-generic/include/odp/drv/plat/spinlock_types.h new file mode 100644 index 0000000..41dd9ac --- /dev/null +++ b/platform/linux-generic/include/odp/drv/plat/spinlock_types.h @@ -0,0 +1,33 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV spinlock + */ + +#ifndef ODPDRV_SPINLOCK_TYPES_H_ +#define ODPDRV_SPINLOCK_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/drv/std_types.h> + +/** @internal */ +struct odpdrv_spinlock_s { + char lock; /**< lock flag, should match odpdrv_atomic_flag_t */ +}; + +typedef struct odpdrv_spinlock_s odpdrv_spinlock_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/drv/spinlock.h b/platform/linux-generic/include/odp/drv/spinlock.h new file mode 100644 index 0000000..dd05f8c --- /dev/null +++ b/platform/linux-generic/include/odp/drv/spinlock.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV spinlock + */ + +#ifndef ODPDRV_PLAT_SPINLOCK_H_ +#define ODPDRV_PLAT_SPINLOCK_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/drv/plat/spinlock_types.h> + +#include <odp/drv/spec/spinlock.h> + +#ifdef __cplusplus +} +#endif + +#endif
commit d5a6c1289da50b0923e5db7293d21fabb22ffeb3 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:25 2016 +0200
drv: adding spinlock.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/drv/spec/spinlock.h b/include/odp/drv/spec/spinlock.h new file mode 100644 index 0000000..52efb56 --- /dev/null +++ b/include/odp/drv/spec/spinlock.h @@ -0,0 +1,86 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV spinlock + */ + +#ifndef ODPDRV_API_SPINLOCK_H_ +#define ODPDRV_API_SPINLOCK_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup odpdrv_locks + * @details + * <b> Spin lock (odpdrv_spinlock_t) </b> + * + * Spinlock simply re-tries to acquire the lock as long as takes to succeed. + * Spinlock is not fair since some threads may succeed more often than others. + * @{ + */ + +/** + * @typedef odpdrv_spinlock_t + * ODPDRV spinlock + */ + +/** + * Initialize spin lock. + * + * @param splock Pointer to a spin lock + */ +void odpdrv_spinlock_init(odpdrv_spinlock_t *splock); + +/** + * Acquire spin lock. + * + * @param splock Pointer to a spin lock + */ +void odpdrv_spinlock_lock(odpdrv_spinlock_t *splock); + +/** + * Try to acquire spin lock. + * + * @param splock Pointer to a spin lock + * + * @retval 0 lock not acquired + * @retval !0 lock acquired + */ +int odpdrv_spinlock_trylock(odpdrv_spinlock_t *splock); + +/** + * Release spin lock. + * + * @param splock Pointer to a spin lock + */ +void odpdrv_spinlock_unlock(odpdrv_spinlock_t *splock); + +/** + * Check if spin lock is busy (locked). + * + * @param splock Pointer to a spin lock + * + * @retval 1 lock busy (locked) + * @retval 0 lock not busy. + */ +int odpdrv_spinlock_is_locked(odpdrv_spinlock_t *splock); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 900b023..404c798 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -67,5 +67,6 @@ odpdrvspecinclude_HEADERS = \ $(top_srcdir)/include/odp/drv/spec/atomic.h \ $(top_srcdir)/include/odp/drv/spec/byteorder.h \ $(top_srcdir)/include/odp/drv/spec/compiler.h \ + $(top_srcdir)/include/odp/drv/spec/spinlock.h \ $(top_srcdir)/include/odp/drv/spec/std_types.h \ $(top_srcdir)/include/odp/drv/spec/sync.h
commit a3eae446071b31767ea8b1a27ceb412cd36ab66b Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:24 2016 +0200
linux-generic: cosmetic changes on spinlock
To please check-patch before the copy to the drv interface.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/spinlock.h b/include/odp/api/spec/spinlock.h index 87f9b83..11b7339 100644 --- a/include/odp/api/spec/spinlock.h +++ b/include/odp/api/spec/spinlock.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */
- /** * @file * @@ -41,7 +40,6 @@ extern "C" { */ void odp_spinlock_init(odp_spinlock_t *splock);
- /** * Acquire spin lock. * @@ -49,7 +47,6 @@ void odp_spinlock_init(odp_spinlock_t *splock); */ void odp_spinlock_lock(odp_spinlock_t *splock);
- /** * Try to acquire spin lock. * @@ -60,7 +57,6 @@ void odp_spinlock_lock(odp_spinlock_t *splock); */ int odp_spinlock_trylock(odp_spinlock_t *splock);
- /** * Release spin lock. * @@ -68,7 +64,6 @@ int odp_spinlock_trylock(odp_spinlock_t *splock); */ void odp_spinlock_unlock(odp_spinlock_t *splock);
- /** * Check if spin lock is busy (locked). * @@ -79,8 +74,6 @@ void odp_spinlock_unlock(odp_spinlock_t *splock); */ int odp_spinlock_is_locked(odp_spinlock_t *splock);
- - /** * @} */ diff --git a/platform/linux-generic/odp_spinlock.c b/platform/linux-generic/odp_spinlock.c index 6fc138b..cb0f053 100644 --- a/platform/linux-generic/odp_spinlock.c +++ b/platform/linux-generic/odp_spinlock.c @@ -13,7 +13,6 @@ void odp_spinlock_init(odp_spinlock_t *spinlock) _odp_atomic_flag_init(&spinlock->lock, 0); }
- void odp_spinlock_lock(odp_spinlock_t *spinlock) { /* While the lock is already taken... */ @@ -25,19 +24,16 @@ void odp_spinlock_lock(odp_spinlock_t *spinlock) odp_cpu_pause(); }
- int odp_spinlock_trylock(odp_spinlock_t *spinlock) { return (_odp_atomic_flag_tas(&spinlock->lock) == 0); }
- void odp_spinlock_unlock(odp_spinlock_t *spinlock) { _odp_atomic_flag_clear(&spinlock->lock); }
- int odp_spinlock_is_locked(odp_spinlock_t *spinlock) { return _odp_atomic_flag_load(&spinlock->lock) != 0;
commit 1ed6a4fab0cc48e1d1a8978a36b84c4d5334647c Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:23 2016 +0200
linux-generic: drv: adding atomic
Based on API interface files.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp_drv.h b/include/odp_drv.h index 6d2f7ff..35e070c 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -19,6 +19,7 @@ extern C { #endif
#include <odp/drv/align.h> +#include <odp/drv/atomic.h> #include <odp/drv/byteorder.h> #include <odp/drv/compiler.h> #include <odp/drv/std_types.h> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 20b4b29..109b42e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -94,6 +94,7 @@ odpapiplatinclude_HEADERS = \ odpdrvincludedir = $(includedir)/odp/drv odpdrvinclude_HEADERS = \ $(srcdir)/include/odp/drv/align.h \ + $(srcdir)/include/odp/drv/atomic.h \ $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h \ $(srcdir)/include/odp/drv/std_types.h \ @@ -101,6 +102,7 @@ odpdrvinclude_HEADERS = \
odpdrvplatincludedir = $(includedir)/odp/drv/plat odpdrvplatinclude_HEADERS = \ + $(srcdir)/include/odp/drv/plat/atomic_types.h \ $(srcdir)/include/odp/drv/plat/byteorder_types.h
noinst_HEADERS = \ @@ -198,6 +200,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_traffic_mngr.c \ odp_version.c \ odp_weak.c \ + drv_atomic.c \ arch/@ARCH_DIR@/odp_cpu_arch.c \ arch/@ARCH_DIR@/odp_sysinfo_parse.c
diff --git a/platform/linux-generic/drv_atomic.c b/platform/linux-generic/drv_atomic.c new file mode 100644 index 0000000..72c85e8 --- /dev/null +++ b/platform/linux-generic/drv_atomic.c @@ -0,0 +1,26 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/drv/atomic.h> + +int odpdrv_atomic_lock_free_u64(odpdrv_atomic_op_t *atomic_op) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + /* All operations have locks */ + if (atomic_op) + atomic_op->all_bits = 0; + + return 0; +#else + /* All operations are lock-free */ + if (atomic_op) { + atomic_op->all_bits = ~((uint32_t)0); + atomic_op->op.init = 0; + } + + return 2; +#endif +} diff --git a/platform/linux-generic/include/odp/drv/atomic.h b/platform/linux-generic/include/odp/drv/atomic.h new file mode 100644 index 0000000..7d922da --- /dev/null +++ b/platform/linux-generic/include/odp/drv/atomic.h @@ -0,0 +1,430 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV atomic operations + */ + +#ifndef ODPDRV_PLAT_ATOMIC_H_ +#define ODPDRV_PLAT_ATOMIC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/drv/align.h> +#include <odp/drv/plat/atomic_types.h> + +/** @ingroup odpdrv_atomic + * @{ + */ + +static inline void odpdrv_atomic_init_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); +} + +static inline uint32_t odpdrv_atomic_load_u32(odpdrv_atomic_u32_t *atom) +{ + return __atomic_load_n(&atom->v, __ATOMIC_RELAXED); +} + +static inline void odpdrv_atomic_store_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); +} + +static inline uint32_t odpdrv_atomic_fetch_add_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); +} + +static inline void odpdrv_atomic_add_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); +} + +static inline uint32_t odpdrv_atomic_fetch_sub_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); +} + +static inline void odpdrv_atomic_sub_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); +} + +static inline uint32_t odpdrv_atomic_fetch_inc_u32(odpdrv_atomic_u32_t *atom) +{ + return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); +} + +static inline void odpdrv_atomic_inc_u32(odpdrv_atomic_u32_t *atom) +{ + (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); +} + +static inline uint32_t odpdrv_atomic_fetch_dec_u32(odpdrv_atomic_u32_t *atom) +{ + return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); +} + +static inline void odpdrv_atomic_dec_u32(odpdrv_atomic_u32_t *atom) +{ + (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); +} + +static inline int odpdrv_atomic_cas_u32(odpdrv_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) +{ + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_RELAXED, + __ATOMIC_RELAXED); +} + +static inline uint32_t odpdrv_atomic_xchg_u32(odpdrv_atomic_u32_t *atom, + uint32_t new_val) +{ + return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED); +} + +static inline void odpdrv_atomic_max_u32(odpdrv_atomic_u32_t *atom, + uint32_t new_max) +{ + uint32_t old_val; + + old_val = odpdrv_atomic_load_u32(atom); + + while (new_max > old_val) { + if (odpdrv_atomic_cas_u32(atom, &old_val, new_max)) + break; + } +} + +static inline void odpdrv_atomic_min_u32(odpdrv_atomic_u32_t *atom, + uint32_t new_min) +{ + uint32_t old_val; + + old_val = odpdrv_atomic_load_u32(atom); + + while (new_min < old_val) { + if (odpdrv_atomic_cas_u32(atom, &old_val, new_min)) + break; + } +} + +static inline void odpdrv_atomic_init_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ + atom->v = val; +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + __atomic_clear(&atom->lock, __ATOMIC_RELAXED); +#endif +} + +static inline uint64_t odpdrv_atomic_load_u64(odpdrv_atomic_u64_t *atom) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, (void)0); +#else + return __atomic_load_n(&atom->v, __ATOMIC_RELAXED); +#endif +} + +static inline void odpdrv_atomic_store_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v = val); +#else + __atomic_store_n(&atom->v, val, __ATOMIC_RELAXED); +#endif +} + +static inline uint64_t odpdrv_atomic_fetch_add_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, atom->v += val); +#else + return __atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); +#endif +} + +static inline void odpdrv_atomic_add_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v += val); +#else + (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELAXED); +#endif +} + +static inline uint64_t odpdrv_atomic_fetch_sub_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, atom->v -= val); +#else + return __atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); +#endif +} + +static inline void odpdrv_atomic_sub_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v -= val); +#else + (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELAXED); +#endif +} + +static inline uint64_t odpdrv_atomic_fetch_inc_u64(odpdrv_atomic_u64_t *atom) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, atom->v++); +#else + return __atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); +#endif +} + +static inline void odpdrv_atomic_inc_u64(odpdrv_atomic_u64_t *atom) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v++); +#else + (void)__atomic_fetch_add(&atom->v, 1, __ATOMIC_RELAXED); +#endif +} + +static inline uint64_t odpdrv_atomic_fetch_dec_u64(odpdrv_atomic_u64_t *atom) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, atom->v--); +#else + return __atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); +#endif +} + +static inline void odpdrv_atomic_dec_u64(odpdrv_atomic_u64_t *atom) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v--); +#else + (void)__atomic_fetch_sub(&atom->v, 1, __ATOMIC_RELAXED); +#endif +} + +static inline int odpdrv_atomic_cas_u64(odpdrv_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + int ret; + *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val)); + return ret; +#else + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_RELAXED, + __ATOMIC_RELAXED); +#endif +} + +static inline uint64_t odpdrv_atomic_xchg_u64(odpdrv_atomic_u64_t *atom, + uint64_t new_val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, atom->v = new_val); +#else + return __atomic_exchange_n(&atom->v, new_val, __ATOMIC_RELAXED); +#endif +} + +static inline void odpdrv_atomic_max_u64(odpdrv_atomic_u64_t *atom, + uint64_t new_max) +{ + uint64_t old_val; + + old_val = odpdrv_atomic_load_u64(atom); + + while (new_max > old_val) { + if (odpdrv_atomic_cas_u64(atom, &old_val, new_max)) + break; + } +} + +static inline void odpdrv_atomic_min_u64(odpdrv_atomic_u64_t *atom, + uint64_t new_min) +{ + uint64_t old_val; + + old_val = odpdrv_atomic_load_u64(atom); + + while (new_min < old_val) { + if (odpdrv_atomic_cas_u64(atom, &old_val, new_min)) + break; + } +} + +static inline uint32_t odpdrv_atomic_load_acq_u32(odpdrv_atomic_u32_t *atom) +{ + return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE); +} + +static inline void odpdrv_atomic_store_rel_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE); +} + +static inline void odpdrv_atomic_add_rel_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE); +} + +static inline void odpdrv_atomic_sub_rel_u32(odpdrv_atomic_u32_t *atom, + uint32_t val) +{ + (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE); +} + +static inline int odpdrv_atomic_cas_acq_u32(odpdrv_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) +{ + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_ACQUIRE, + __ATOMIC_RELAXED); +} + +static inline int odpdrv_atomic_cas_rel_u32(odpdrv_atomic_u32_t *atom, + uint32_t *old_val, uint32_t new_val) +{ + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_RELEASE, + __ATOMIC_RELAXED); +} + +static inline int odpdrv_atomic_cas_acq_rel_u32(odpdrv_atomic_u32_t *atom, + uint32_t *old_val, + uint32_t new_val) +{ + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_ACQ_REL, + __ATOMIC_RELAXED); +} + +static inline uint64_t odpdrv_atomic_load_acq_u64(odpdrv_atomic_u64_t *atom) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + return ATOMIC_OP(atom, (void)0); +#else + return __atomic_load_n(&atom->v, __ATOMIC_ACQUIRE); +#endif +} + +static inline void odpdrv_atomic_store_rel_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v = val); +#else + __atomic_store_n(&atom->v, val, __ATOMIC_RELEASE); +#endif +} + +static inline void odpdrv_atomic_add_rel_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v += val); +#else + (void)__atomic_fetch_add(&atom->v, val, __ATOMIC_RELEASE); +#endif +} + +static inline void odpdrv_atomic_sub_rel_u64(odpdrv_atomic_u64_t *atom, + uint64_t val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + (void)ATOMIC_OP(atom, atom->v -= val); +#else + (void)__atomic_fetch_sub(&atom->v, val, __ATOMIC_RELEASE); +#endif +} + +static inline int odpdrv_atomic_cas_acq_u64(odpdrv_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + int ret; + *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val)); + return ret; +#else + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_ACQUIRE, + __ATOMIC_RELAXED); +#endif +} + +static inline int odpdrv_atomic_cas_rel_u64(odpdrv_atomic_u64_t *atom, + uint64_t *old_val, uint64_t new_val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + int ret; + *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val)); + return ret; +#else + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_RELEASE, + __ATOMIC_RELAXED); +#endif +} + +static inline int odpdrv_atomic_cas_acq_rel_u64(odpdrv_atomic_u64_t *atom, + uint64_t *old_val, + uint64_t new_val) +{ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + int ret; + *old_val = ATOMIC_OP(atom, ATOMIC_CAS_OP(&ret, *old_val, new_val)); + return ret; +#else + return __atomic_compare_exchange_n(&atom->v, old_val, new_val, + 0 /* strong */, + __ATOMIC_ACQ_REL, + __ATOMIC_RELAXED); +#endif +} + +/** + * @} + */ + +#include <odp/drv/spec/atomic.h> + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/drv/plat/atomic_types.h b/platform/linux-generic/include/odp/drv/plat/atomic_types.h new file mode 100644 index 0000000..6a7ff0d --- /dev/null +++ b/platform/linux-generic/include/odp/drv/plat/atomic_types.h @@ -0,0 +1,88 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV atomic operations + */ + +#ifndef ODPDRV_ATOMIC_TYPES_H_ +#define ODPDRV_ATOMIC_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/drv/std_types.h> +#include <odp/drv/align.h> + +/** + * @internal + * Atomic 64-bit unsigned integer + */ +struct odpdrv_atomic_u64_s { + uint64_t v; /**< Actual storage for the atomic variable */ +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + /* Some architectures do not support lock-free operations on 64-bit + * data types. We use a spin lock to ensure atomicity. */ + char lock; /**< Spin lock (if needed) used to ensure atomic access */ +#endif +} ODPDRV_ALIGNED(sizeof(uint64_t)); /* Enforce alignement! */; + +/** + * @internal + * Atomic 32-bit unsigned integer + */ +struct odpdrv_atomic_u32_s { + uint32_t v; /**< Actual storage for the atomic variable */ +} ODPDRV_ALIGNED(sizeof(uint32_t)); /* Enforce alignement! */; + +#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2 + +/** + * @internal + * CAS operation expression for the ATOMIC_OP macro + */ +#define ATOMIC_CAS_OP(ret_ptr, old_val, new_val) \ +({ \ + if (atom->v == (old_val)) { \ + atom->v = (new_val); \ + *(ret_ptr) = 1; \ + } else { \ + *(ret_ptr) = 0; \ + } \ +}) + +/** + * @internal + * Helper macro for lock-based atomic operations on 64-bit integers + * @param[in,out] atom Pointer to the 64-bit atomic variable + * @param expr Expression used update the variable. + * @return The old value of the variable. + */ +#define ATOMIC_OP(atom, expr) \ +({ \ + uint64_t _old_val; \ + /* Loop while lock is already taken, stop when lock becomes clear */ \ + while (__atomic_test_and_set(&(atom)->lock, __ATOMIC_ACQUIRE)) \ + (void)0; \ + _old_val = (atom)->v; \ + (expr); /* Perform whatever update is desired */ \ + __atomic_clear(&(atom)->lock, __ATOMIC_RELEASE); \ + _old_val; /* Return old value */ \ +}) +#endif + +typedef struct odpdrv_atomic_u64_s odpdrv_atomic_u64_t; + +typedef struct odpdrv_atomic_u32_s odpdrv_atomic_u32_t; + +#ifdef __cplusplus +} +#endif + +#endif
commit c62004cb48ab1cba876ae46d19adbf14641c8476 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:22 2016 +0200
drv: adding atomic.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/drv/spec/atomic.h b/include/odp/drv/spec/atomic.h new file mode 100644 index 0000000..3cb6e9b --- /dev/null +++ b/include/odp/drv/spec/atomic.h @@ -0,0 +1,634 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV atomic operations + */ + +#ifndef ODPDRV_API_ATOMIC_H_ +#define ODPDRV_API_ATOMIC_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup odpdrv_atomic ODPDRV ATOMIC + * @details + * <b> Atomic integers using relaxed memory ordering </b> + * + * Atomic integer types (odpdrv_atomic_u32_t and odpdrv_atomic_u64_t) can be + * used to implement e.g. shared counters. If not otherwise documented, + * operations in this API are implemented using <b> RELAXED memory ordering </b> + * (see memory order descriptions in the C11 specification). Relaxed operations + * do not provide synchronization or ordering for other memory accesses + * (initiated before or after the operation), only atomicity of the operation + * itself is guaranteed. + * + * <b> Operations with non-relaxed memory ordering </b> + * + * <b> An operation with RELEASE </b> memory ordering + * (odpdrv_atomic_xxx_rel_xxx()) ensures that other threads loading the same + * atomic variable with ACQUIRE memory ordering see all stores (from the + * calling thread) that happened before this releasing store. + * + * <b> An operation with ACQUIRE </b> memory ordering + * (odpdrv_atomic_xxx_acq_xxx()) ensures that the calling thread sees all stores + * (done by the releasing thread) that happened before a RELEASE memory ordered + * store to the same atomic variable. + * + * <b> An operation with ACQUIRE-and-RELEASE </b> memory ordering + * (odpdrv_atomic_xxx_acq_rel_xxx()) combines the effects of ACQUIRE and RELEASE + * memory orders. A single operation acts as both an acquiring load and + * a releasing store. + * + * @{ + */ + +/** + * @typedef odpdrv_atomic_u64_t + * Atomic 64-bit unsigned integer + * + * @typedef odpdrv_atomic_u32_t + * Atomic 32-bit unsigned integer + */ + +/* + * 32-bit operations in RELAXED memory ordering + * -------------------------------------------- + */ + +/** + * Initialize atomic uint32 variable + * + * Initializes the atomic variable with 'val'. This operation is not atomic. + * Drivers must ensure that there's no race condition while initializing + * the variable. + * + * @param atom Pointer to atomic variable + * @param val Value to initialize the variable with + */ +void odpdrv_atomic_init_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Load value of atomic uint32 variable + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable + */ +uint32_t odpdrv_atomic_load_u32(odpdrv_atomic_u32_t *atom); + +/** + * Store value to atomic uint32 variable + * + * @param atom Pointer to atomic variable + * @param val Value to store in the variable + */ +void odpdrv_atomic_store_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Fetch and add to atomic uint32 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be added to the variable + * + * @return Value of the variable before the addition + */ +uint32_t odpdrv_atomic_fetch_add_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Add to atomic uint32 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be added to the variable + */ +void odpdrv_atomic_add_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Fetch and subtract from atomic uint32 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be subracted from the variable + * + * @return Value of the variable before the subtraction + */ +uint32_t odpdrv_atomic_fetch_sub_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Subtract from atomic uint32 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be subtracted from the variable + */ +void odpdrv_atomic_sub_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Fetch and increment atomic uint32 variable + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable before the increment + */ +uint32_t odpdrv_atomic_fetch_inc_u32(odpdrv_atomic_u32_t *atom); + +/** + * Increment atomic uint32 variable + * + * @param atom Pointer to atomic variable + */ +void odpdrv_atomic_inc_u32(odpdrv_atomic_u32_t *atom); + +/** + * Fetch and decrement atomic uint32 variable + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable before the subtraction + */ +uint32_t odpdrv_atomic_fetch_dec_u32(odpdrv_atomic_u32_t *atom); + +/** + * Decrement atomic uint32 variable + * + * @param atom Pointer to atomic variable + */ +void odpdrv_atomic_dec_u32(odpdrv_atomic_u32_t *atom); + +/** + * Update maximum value of atomic uint32 variable + * + * Compares value of atomic variable to the new maximum value. If the new value + * is greater than the current value, writes the new value into the variable. + * + * @param atom Pointer to atomic variable + * @param new_max New maximum value to be written into the atomic variable + */ +void odpdrv_atomic_max_u32(odpdrv_atomic_u32_t *atom, uint32_t new_max); + +/** + * Update minimum value of atomic uint32 variable + * + * Compares value of atomic variable to the new minimum value. If the new value + * is less than the current value, writes the new value into the variable. + * + * @param atom Pointer to atomic variable + * @param new_min New minimum value to be written into the atomic variable + */ +void odpdrv_atomic_min_u32(odpdrv_atomic_u32_t *atom, uint32_t new_min); + +/** + * Compare and swap atomic uint32 variable + * + * Compares value of atomic variable to the value pointed by 'old_val'. + * If values are equal, the operation writes 'new_val' into the atomic variable + * and returns success. If they are not equal, the operation writes current + * value of atomic variable into 'old_val' and returns failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + * + */ +int odpdrv_atomic_cas_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val, + uint32_t new_val); + +/** + * Exchange value of atomic uint32 variable + * + * Atomically replaces the value of atomic variable with the new value. Returns + * the old value. + * + * @param atom Pointer to atomic variable + * @param new_val New value of the atomic variable + * + * @return Value of the variable before the operation + */ +uint32_t odpdrv_atomic_xchg_u32(odpdrv_atomic_u32_t *atom, uint32_t new_val); + +/* + * 64-bit operations in RELAXED memory ordering + * -------------------------------------------- + */ + +/** + * Initialize atomic uint64 variable + * + * Initializes the atomic variable with 'val'. This operation is not atomic. + * Drivers must ensure that there's no race condition while initializing + * the variable. + * + * @param atom Pointer to atomic variable + * @param val Value to initialize the variable with + */ +void odpdrv_atomic_init_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Load value of atomic uint64 variable + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable + */ +uint64_t odpdrv_atomic_load_u64(odpdrv_atomic_u64_t *atom); + +/** + * Store value to atomic uint64 variable + * + * @param atom Pointer to atomic variable + * @param val Value to store in the variable + */ +void odpdrv_atomic_store_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Fetch and add to atomic uint64 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be added to the variable + * + * @return Value of the variable before the addition + */ +uint64_t odpdrv_atomic_fetch_add_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Add to atomic uint64 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be added to the variable + */ +void odpdrv_atomic_add_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Fetch and subtract from atomic uint64 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be subtracted from the variable + * + * @return Value of the variable before the subtraction + */ +uint64_t odpdrv_atomic_fetch_sub_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Subtract from atomic uint64 variable + * + * @param atom Pointer to atomic variable + * @param val Value to be subtracted from the variable + */ +void odpdrv_atomic_sub_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Fetch and increment atomic uint64 variable + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable before the increment + */ +uint64_t odpdrv_atomic_fetch_inc_u64(odpdrv_atomic_u64_t *atom); + +/** + * Increment atomic uint64 variable + * + * @param atom Pointer to atomic variable + */ +void odpdrv_atomic_inc_u64(odpdrv_atomic_u64_t *atom); + +/** + * Fetch and decrement atomic uint64 variable + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable before the decrement + */ +uint64_t odpdrv_atomic_fetch_dec_u64(odpdrv_atomic_u64_t *atom); + +/** + * Decrement atomic uint64 variable + * + * @param atom Pointer to atomic variable + */ +void odpdrv_atomic_dec_u64(odpdrv_atomic_u64_t *atom); + +/** + * Update maximum value of atomic uint64 variable + * + * Compares value of atomic variable to the new maximum value. If the new value + * is greater than the current value, writes the new value into the variable. + * + * @param atom Pointer to atomic variable + * @param new_max New maximum value to be written into the atomic variable + */ +void odpdrv_atomic_max_u64(odpdrv_atomic_u64_t *atom, uint64_t new_max); + +/** + * Update minimum value of atomic uint64 variable + * + * Compares value of atomic variable to the new minimum value. If the new value + * is less than the current value, writes the new value into the variable. + * + * @param atom Pointer to atomic variable + * @param new_min New minimum value to be written into the atomic variable + */ +void odpdrv_atomic_min_u64(odpdrv_atomic_u64_t *atom, uint64_t new_min); + +/** + * Compare and swap atomic uint64 variable + * + * Compares value of atomic variable to the value pointed by 'old_val'. + * If values are equal, the operation writes 'new_val' into the atomic variable + * and returns success. If they are not equal, the operation writes current + * value of atomic variable into 'old_val' and returns failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val, + uint64_t new_val); + +/** + * Exchange value of atomic uint64 variable + * + * Atomically replaces the value of atomic variable with the new value. Returns + * the old value. + * + * @param atom Pointer to atomic variable + * @param new_val New value of the atomic variable + * + * @return Value of the variable before the operation + */ +uint64_t odpdrv_atomic_xchg_u64(odpdrv_atomic_u64_t *atom, uint64_t new_val); + +/* + * 32-bit operations in non-RELAXED memory ordering + * ------------------------------------------------ + */ + +/** + * Load value of atomic uint32 variable using ACQUIRE memory ordering + * + * Otherwise identical to odpdrv_atomic_load_u32() but ensures ACQUIRE memory + * ordering. + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable + */ +uint32_t odpdrv_atomic_load_acq_u32(odpdrv_atomic_u32_t *atom); + +/** + * Store value to atomic uint32 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_store_u32() but ensures RELEASE memory + * ordering. + * + * @param atom Pointer to atomic variable + * @param val Value to store in the variable + */ +void odpdrv_atomic_store_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Add to atomic uint32 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_add_u32() but ensures RELEASE memory + * ordering. + * + * @param atom Pointer to atomic variable + * @param val Value to be added to the variable + */ +void odpdrv_atomic_add_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Subtract from atomic uint32 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_sub_u32() but ensures RELEASE memory + * ordering. + * + * @param atom Pointer to atomic variable + * @param val Value to be subtracted from the variable + */ +void odpdrv_atomic_sub_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t val); + +/** + * Compare and swap atomic uint32 variable using ACQUIRE memory ordering + * + * Otherwise identical to odpdrv_atomic_cas_u32() but ensures ACQUIRE memory + * ordering on success. Memory ordering is RELAXED on failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_acq_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val, + uint32_t new_val); + +/** + * Compare and swap atomic uint32 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_cas_u32() but ensures RELEASE memory + * ordering on success. Memory ordering is RELAXED on failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val, + uint32_t new_val); + +/** + * Compare and swap atomic uint32 variable using ACQUIRE-and-RELEASE memory + * ordering + * + * Otherwise identical to odpdrv_atomic_cas_u32() but ensures + * ACQUIRE-and-RELEASE memory ordering on success. + * Memory ordering is RELAXED on failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_acq_rel_u32(odpdrv_atomic_u32_t *atom, uint32_t *old_val, + uint32_t new_val); + +/* + * 64-bit operations in non-RELAXED memory ordering + * ------------------------------------------------ + */ + +/** + * Load value of atomic uint64 variable using ACQUIRE memory ordering + * + * Otherwise identical to odpdrv_atomic_load_u64() but ensures ACQUIRE memory + * ordering. + * + * @param atom Pointer to atomic variable + * + * @return Value of the variable + */ +uint64_t odpdrv_atomic_load_acq_u64(odpdrv_atomic_u64_t *atom); + +/** + * Store value to atomic uint64 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_store_u64() but ensures RELEASE memory + * ordering. + * + * @param atom Pointer to atomic variable + * @param val Value to store in the variable + */ +void odpdrv_atomic_store_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Add to atomic uint64 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_add_u64() but ensures RELEASE memory + * ordering. + * + * @param atom Pointer to atomic variable + * @param val Value to be added to the variable + */ +void odpdrv_atomic_add_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Subtract from atomic uint64 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_sub_u64() but ensures RELEASE memory + * ordering. + * + * @param atom Pointer to atomic variable + * @param val Value to be subtracted from the variable + */ +void odpdrv_atomic_sub_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t val); + +/** + * Compare and swap atomic uint64 variable using ACQUIRE memory ordering + * + * Otherwise identical to odpdrv_atomic_cas_u64() but ensures ACQUIRE memory + * ordering on success. Memory ordering is RELAXED on failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_acq_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val, + uint64_t new_val); + +/** + * Compare and swap atomic uint64 variable using RELEASE memory ordering + * + * Otherwise identical to odpdrv_atomic_cas_u64() but ensures RELEASE memory + * ordering on success. Memory ordering is RELAXED on failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val, + uint64_t new_val); + +/** + * Compare and swap atomic uint64 variable using ACQUIRE-and-RELEASE memory + * ordering + * + * Otherwise identical to odpdrv_atomic_cas_u64() but ensures + * ACQUIRE-and-RELEASE memory ordering on success. Memory ordering is RELAXED + * on failure. + * + * @param atom Pointer to atomic variable + * @param[in,out] old_val Pointer to the old value of the atomic variable. + * Operation updates this value on failure. + * @param new_val New value to be written into the atomic variable + * + * @return 0 on failure, !0 on success + */ +int odpdrv_atomic_cas_acq_rel_u64(odpdrv_atomic_u64_t *atom, uint64_t *old_val, + uint64_t new_val); + +/** + * Atomic operations + * + * Atomic operations listed in a bit field structure. + */ +typedef union odpdrv_atomic_op_t { + /** Operation flags */ + struct { + uint32_t init : 1; /**< Init atomic variable */ + uint32_t load : 1; /**< Atomic load */ + uint32_t store : 1; /**< Atomic store */ + uint32_t fetch_add : 1; /**< Atomic fetch and add */ + uint32_t add : 1; /**< Atomic add */ + uint32_t fetch_sub : 1; /**< Atomic fetch and subtract */ + uint32_t sub : 1; /**< Atomic subtract */ + uint32_t fetch_inc : 1; /**< Atomic fetch and increment */ + uint32_t inc : 1; /**< Atomic increment */ + uint32_t fetch_dec : 1; /**< Atomic fetch and decrement */ + uint32_t dec : 1; /**< Atomic decrement */ + uint32_t min : 1; /**< Atomic minimum */ + uint32_t max : 1; /**< Atomic maximum */ + uint32_t cas : 1; /**< Atomic compare and swap */ + uint32_t xchg : 1; /**< Atomic exchange */ + } op; + + /** All bits of the bit field structure. + * Operation flag mapping is architecture specific. This field can be + * used to set/clear all flags, or bitwise operations over the entire + * structure. */ + uint32_t all_bits; +} odpdrv_atomic_op_t; + +/** + * Query which atomic uint64 operations are lock-free + * + * Lock-free implementations have higher performance and scale better than + * implementations using locks. User can decide to use e.g. uint32 atomic + * variables instead of uint64 to optimize performance on platforms that + * implement a performance critical operation using locks. + * + * Init operations (e.g. odpdrv_atomic_init_64()) are not atomic. This function + * clears the op.init bit but will never set it to one. + * + * @param atomic_op Pointer to atomic operation structure for storing + * operation flags. All bits are initialized to zero during + * the operation. The parameter is ignored when NULL. + * @retval 0 None of the operations are lock-free + * @retval 1 Some of the operations are lock-free + * @retval 2 All operations are lock-free + */ +int odpdrv_atomic_lock_free_u64(odpdrv_atomic_op_t *atomic_op); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index edb598f..900b023 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -64,6 +64,7 @@ odpapispecinclude_HEADERS = \ odpdrvspecincludedir= $(includedir)/odp/drv/spec odpdrvspecinclude_HEADERS = \ $(top_srcdir)/include/odp/drv/spec/align.h \ + $(top_srcdir)/include/odp/drv/spec/atomic.h \ $(top_srcdir)/include/odp/drv/spec/byteorder.h \ $(top_srcdir)/include/odp/drv/spec/compiler.h \ $(top_srcdir)/include/odp/drv/spec/std_types.h \
commit 8a0b084a61b07aae811df1c4fd7eab74b52a6d75 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:21 2016 +0200
linux-generic: cosmetic changes on atomic
To please check-patch before the copy to the drv interface.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h index b8d992d..408829d 100644 --- a/include/odp/api/spec/atomic.h +++ b/include/odp/api/spec/atomic.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */
- /** * @file * diff --git a/platform/linux-generic/include/odp/api/plat/atomic_types.h b/platform/linux-generic/include/odp/api/plat/atomic_types.h index 3bb2bbd..d8a6ea6 100644 --- a/platform/linux-generic/include/odp/api/plat/atomic_types.h +++ b/platform/linux-generic/include/odp/api/plat/atomic_types.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */
- /** * @file *
commit b39a4f517176d7f65210056026d7f7842467bb20 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:20 2016 +0200
linux-generic: drv: adding align.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp_drv.h b/include/odp_drv.h index e2c3bda..6d2f7ff 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -18,6 +18,7 @@ extern C { #endif
+#include <odp/drv/align.h> #include <odp/drv/byteorder.h> #include <odp/drv/compiler.h> #include <odp/drv/std_types.h> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 68db647..20b4b29 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -93,6 +93,7 @@ odpapiplatinclude_HEADERS = \
odpdrvincludedir = $(includedir)/odp/drv odpdrvinclude_HEADERS = \ + $(srcdir)/include/odp/drv/align.h \ $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h \ $(srcdir)/include/odp/drv/std_types.h \ diff --git a/platform/linux-generic/include/odp/drv/align.h b/platform/linux-generic/include/odp/drv/align.h new file mode 100644 index 0000000..eded2e3 --- /dev/null +++ b/platform/linux-generic/include/odp/drv/align.h @@ -0,0 +1,60 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV alignments + */ + +#ifndef ODPDRV_PLAT_ALIGN_H_ +#define ODPDRV_PLAT_ALIGN_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odpdrv_compiler_optim + * @{ + */ + +#ifdef __GNUC__ + +#define ODPDRV_ALIGNED(x) __attribute__((__aligned__(x))) + +#define ODPDRV_PACKED __attribute__((__packed__)) + +#define ODPDRV_OFFSETOF(type, member) __builtin_offsetof(type, member) + +#define ODPDRV_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) + +#if defined __arm__ || defined __aarch64__ + +#define ODPDRV_CACHE_LINE_SIZE 64 + +#endif + +#else +#error Non-gcc compatible compiler +#endif + +#define ODPDRV_PAGE_SIZE 4096 + +#define ODPDRV_ALIGNED_CACHE ODPDRV_ALIGNED(ODPDRV_CACHE_LINE_SIZE) + +#define ODPDRV_ALIGNED_PAGE ODPDRV_ALIGNED(ODPDRV_PAGE_SIZE) + +/** + * @} + */ + +#include <odp/drv/spec/align.h> + +#ifdef __cplusplus +} +#endif + +#endif
commit 283b4a449cefcdf7a9a781b9b126a35598cc9c65 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:19 2016 +0200
drv: adding align.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/drv/spec/align.h b/include/odp/drv/spec/align.h new file mode 100644 index 0000000..2b2f32c --- /dev/null +++ b/include/odp/drv/spec/align.h @@ -0,0 +1,78 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV alignments + */ + +#ifndef ODPDRV_API_ALIGN_H_ +#define ODPDRV_API_ALIGN_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odpdrv_compiler_optim + * Macros that allow cache line size configuration, check that + * alignment is a power of two etc. + * @{ + */ + +/* Checkpatch complains, but cannot use __aligned(size) for this purpose. */ + +/** + * @def ODPDRV_ALIGNED + * Defines type/struct/variable alignment in bytes + */ + +/** + * @def ODPDRV_PACKED + * Defines type/struct to be packed + */ + +/** + * @def ODPDRV_OFFSETOF + * Returns offset of member in type + */ + +/** + * @def ODPDRV_FIELD_SIZEOF + * Returns sizeof member + */ + +/** + * @def ODPDRV_CACHE_LINE_SIZE + * Cache line size + */ + +/** + * @def ODPDRV_PAGE_SIZE + * Page size + */ + +/** + * @def ODPDRV_ALIGNED_CACHE + * Defines type/struct/variable to be cache line size aligned + */ + +/** + * @def ODPDRV_ALIGNED_PAGE + * Defines type/struct/variable to be page size aligned + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index dd3b376..edb598f 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -63,6 +63,7 @@ odpapispecinclude_HEADERS = \
odpdrvspecincludedir= $(includedir)/odp/drv/spec odpdrvspecinclude_HEADERS = \ + $(top_srcdir)/include/odp/drv/spec/align.h \ $(top_srcdir)/include/odp/drv/spec/byteorder.h \ $(top_srcdir)/include/odp/drv/spec/compiler.h \ $(top_srcdir)/include/odp/drv/spec/std_types.h \
commit 701f695013218b1bbaf97212bb00b708ec738819 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:18 2016 +0200
drv: fixing Makefile for compiler.h
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/Makefile.inc b/platform/Makefile.inc index fbf65aa..dd3b376 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -64,5 +64,6 @@ odpapispecinclude_HEADERS = \ odpdrvspecincludedir= $(includedir)/odp/drv/spec odpdrvspecinclude_HEADERS = \ $(top_srcdir)/include/odp/drv/spec/byteorder.h \ + $(top_srcdir)/include/odp/drv/spec/compiler.h \ $(top_srcdir)/include/odp/drv/spec/std_types.h \ $(top_srcdir)/include/odp/drv/spec/sync.h
commit 2deaffd485fec676e29e379451d8f1ebdde79c54 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:17 2016 +0200
drv: fixing Makefile for std_types
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 21f2922..fbf65aa 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -64,4 +64,5 @@ odpapispecinclude_HEADERS = \ odpdrvspecincludedir= $(includedir)/odp/drv/spec odpdrvspecinclude_HEADERS = \ $(top_srcdir)/include/odp/drv/spec/byteorder.h \ + $(top_srcdir)/include/odp/drv/spec/std_types.h \ $(top_srcdir)/include/odp/drv/spec/sync.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 4ef8ac1..68db647 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -95,6 +95,7 @@ odpdrvincludedir = $(includedir)/odp/drv odpdrvinclude_HEADERS = \ $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h \ + $(srcdir)/include/odp/drv/std_types.h \ $(srcdir)/include/odp/drv/sync.h
odpdrvplatincludedir = $(includedir)/odp/drv/plat
commit e2bea00c339c2aae29476b436bcd6ee3b9a51342 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:16 2016 +0200
linux-generic: drv: adding sync.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp_drv.h b/include/odp_drv.h index 1956e8c..e2c3bda 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -21,6 +21,7 @@ extern C { #include <odp/drv/byteorder.h> #include <odp/drv/compiler.h> #include <odp/drv/std_types.h> +#include <odp/drv/sync.h>
#ifdef __cplusplus } diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 5b70fb4..4ef8ac1 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -94,7 +94,8 @@ odpapiplatinclude_HEADERS = \ odpdrvincludedir = $(includedir)/odp/drv odpdrvinclude_HEADERS = \ $(srcdir)/include/odp/drv/byteorder.h \ - $(srcdir)/include/odp/drv/compiler.h + $(srcdir)/include/odp/drv/compiler.h \ + $(srcdir)/include/odp/drv/sync.h
odpdrvplatincludedir = $(includedir)/odp/drv/plat odpdrvplatinclude_HEADERS = \ diff --git a/platform/linux-generic/include/odp/drv/sync.h b/platform/linux-generic/include/odp/drv/sync.h new file mode 100644 index 0000000..5852138 --- /dev/null +++ b/platform/linux-generic/include/odp/drv/sync.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV synchronisation + */ + +#ifndef ODPDRV_PLAT_SYNC_H_ +#define ODPDRV_PLAT_SYNC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odpdrv_barrier + * @{ + */ + +static inline void odpdrv_mb_release(void) +{ + __atomic_thread_fence(__ATOMIC_RELEASE); +} + +static inline void odpdrv_mb_acquire(void) +{ + __atomic_thread_fence(__ATOMIC_ACQUIRE); +} + +static inline void odpdrv_mb_full(void) +{ + __atomic_thread_fence(__ATOMIC_SEQ_CST); +} + +/** + * @} + */ + +#include <odp/drv/spec/sync.h> + +#ifdef __cplusplus +} +#endif + +#endif
commit ff5dd845b8ea8a3ecafeeca366b0d950d1455a25 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:15 2016 +0200
drv: adding sync.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/drv/spec/sync.h b/include/odp/drv/spec/sync.h new file mode 100644 index 0000000..ea60685 --- /dev/null +++ b/include/odp/drv/spec/sync.h @@ -0,0 +1,91 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV memory barriers + */ + +#ifndef ODPDRV_API_SYNC_H_ +#define ODPDRV_API_SYNC_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup odpdrv_barrier + * @details + * <b> Memory barriers </b> + * + * Memory barriers enforce ordering of memory load and store operations + * specified before and after the barrier. These barriers may affect both + * compiler optimizations and CPU out-of-order execution. All ODPDRV + * synchronization mechanisms (e.g. execution barriers, locks, queues, etc ) + * include all necessary memory barriers, so these calls are not needed when + * using those. Also ODPDRV atomic operations have memory ordered versions. + * These explicit barriers may be needed when thread synchronization is based on + * a non-ODPDRV defined mechanism. Depending on the HW platform, heavy usage of + * memory barriers may cause significant performance degradation. + * + * @{ + */ + +/** + * Memory barrier for release operations + * + * This memory barrier has release semantics. It synchronizes with a pairing + * barrier for acquire operations. The releasing and acquiring threads + * synchronize through shared memory. The releasing thread must call this + * barrier before signaling the acquiring thread. After the acquiring thread + * receives the signal, it must call odpdrv_mb_acquire() before it reads the + * memory written by the releasing thread. + * + * This call is not needed when using ODPDRV defined synchronization mechanisms. + * + * @see odpdrv_mb_acquire() + */ +void odpdrv_mb_release(void); + +/** + * Memory barrier for acquire operations + * + * This memory barrier has acquire semantics. It synchronizes with a pairing + * barrier for release operations. The releasing and acquiring threads + * synchronize through shared memory. The releasing thread must call + * odpdrv_mb_release() before signaling the acquiring thread. After the + * acquiring thread receives the signal, it must call this barrier before it + * read the memory written by the releasing thread. + * + * This call is not needed when using ODPDRV defined synchronization mechanisms. + * + * @see odpdrv_mb_release() + */ +void odpdrv_mb_acquire(void); + +/** + * Full memory barrier + * + * This is a full memory barrier. It guarantees that all load and store + * operations specified before it are visible to other threads before + * all load and store operations specified after it. + * + * This call is not needed when using ODPDRV defined synchronization mechanisms. + */ +void odpdrv_mb_full(void); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 9fea4a7..21f2922 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -63,4 +63,5 @@ odpapispecinclude_HEADERS = \
odpdrvspecincludedir= $(includedir)/odp/drv/spec odpdrvspecinclude_HEADERS = \ - $(top_srcdir)/include/odp/drv/spec/byteorder.h + $(top_srcdir)/include/odp/drv/spec/byteorder.h \ + $(top_srcdir)/include/odp/drv/spec/sync.h
commit d82a651c0029a13c27065d57a68fd471785dc97c Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:14 2016 +0200
linux-generic: cosmetic changes on sync files
To please check-patch before the copy to the drv interface.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/sync.h b/include/odp/api/spec/sync.h index b48e0ab..6f87db5 100644 --- a/include/odp/api/spec/sync.h +++ b/include/odp/api/spec/sync.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */
- /** * @file *
commit d01c316a31f02155f55ea898a35381ff5060bfa9 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:13 2016 +0200
linux-generic: drv: adding byteorder.h
Based on API interface files.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp_drv.h b/include/odp_drv.h index a6d3a44..1956e8c 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -18,6 +18,7 @@ extern C { #endif
+#include <odp/drv/byteorder.h> #include <odp/drv/compiler.h> #include <odp/drv/std_types.h>
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 991ccd2..5b70fb4 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -93,8 +93,13 @@ odpapiplatinclude_HEADERS = \
odpdrvincludedir = $(includedir)/odp/drv odpdrvinclude_HEADERS = \ + $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h
+odpdrvplatincludedir = $(includedir)/odp/drv/plat +odpdrvplatinclude_HEADERS = \ + $(srcdir)/include/odp/drv/plat/byteorder_types.h + noinst_HEADERS = \ ${srcdir}/include/odp_align_internal.h \ ${srcdir}/include/odp_atomic_internal.h \ diff --git a/platform/linux-generic/include/odp/drv/byteorder.h b/platform/linux-generic/include/odp/drv/byteorder.h new file mode 100644 index 0000000..709a520 --- /dev/null +++ b/platform/linux-generic/include/odp/drv/byteorder.h @@ -0,0 +1,146 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV byteorder + */ + +#ifndef ODPDRVP_PLAT_BYTEORDER_H_ +#define ODPDRVP_PLAT_BYTEORDER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/drv/plat/byteorder_types.h> +#include <odp/drv/std_types.h> +#include <odp/drv/compiler.h> + +/** @ingroup odpdrv_compiler_optim + * @{ + */ + +static inline uint16_t odpdrv_be_to_cpu_16(odpdrv_u16be_t be16) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return __odpdrv_builtin_bswap16((__odpdrv_force uint16_t)be16); +#else + return (__odpdrv_force uint16_t)be16; +#endif +} + +static inline uint32_t odpdrv_be_to_cpu_32(odpdrv_u32be_t be32) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return __builtin_bswap32((__odpdrv_force uint32_t)be32); +#else + return (__odpdrv_force uint32_t)be32; +#endif +} + +static inline uint64_t odpdrv_be_to_cpu_64(odpdrv_u64be_t be64) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return __builtin_bswap64((__odpdrv_force uint64_t)be64); +#else + return (__odpdrv_force uint64_t)be64; +#endif +} + +static inline odpdrv_u16be_t odpdrv_cpu_to_be_16(uint16_t cpu16) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force odpdrv_u16be_t)__odpdrv_builtin_bswap16(cpu16); +#else + return (__odpdrv_force odpdrv_u16be_t)cpu16; +#endif +} + +static inline odpdrv_u32be_t odpdrv_cpu_to_be_32(uint32_t cpu32) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force odpdrv_u32be_t)__builtin_bswap32(cpu32); +#else + return (__odpdrv_force odpdrv_u32be_t)cpu32; +#endif +} + +static inline odpdrv_u64be_t odpdrv_cpu_to_be_64(uint64_t cpu64) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force odpdrv_u64be_t)__builtin_bswap64(cpu64); +#else + return (__odpdrv_force odpdrv_u64be_t)cpu64; +#endif +} + +static inline uint16_t odpdrv_le_to_cpu_16(odpdrv_u16le_t le16) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force uint16_t)le16; +#else + return __odpdrv_builtin_bswap16((__odpdrv_force uint16_t)le16); +#endif +} + +static inline uint32_t odpdrv_le_to_cpu_32(odpdrv_u32le_t le32) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force uint32_t)le32; +#else + return __builtin_bswap32((__odpdrv_force uint32_t)le32); +#endif +} + +static inline uint64_t odpdrv_le_to_cpu_64(odpdrv_u64le_t le64) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force uint64_t)le64; +#else + return __builtin_bswap64((__odpdrv_force uint64_t)le64); +#endif +} + +static inline odpdrv_u16le_t odpdrv_cpu_to_le_16(uint16_t cpu16) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force odpdrv_u16le_t)cpu16; +#else + return (__odpdrv_force odpdrv_u16le_t)__odpdrv_builtin_bswap16(cpu16); +#endif +} + +static inline odpdrv_u32le_t odpdrv_cpu_to_le_32(uint32_t cpu32) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force odpdrv_u32le_t)cpu32; +#else + return (__odpdrv_force odpdrv_u32le_t)__builtin_bswap32(cpu32); +#endif +} + +static inline odpdrv_u64le_t odpdrv_cpu_to_le_64(uint64_t cpu64) +{ +#if ODPDRVP_BYTE_ORDER == ODPDRVP_LITTLE_ENDIAN + return (__odpdrv_force odpdrv_u64le_t)cpu64; +#else + return (__odpdrv_force odpdrv_u64le_t)__builtin_bswap64(cpu64); +#endif +} + +/** + * @} + */ + +#include <odp/drv/spec/byteorder.h> + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/drv/plat/byteorder_types.h b/platform/linux-generic/include/odp/drv/plat/byteorder_types.h new file mode 100644 index 0000000..bf461e5 --- /dev/null +++ b/platform/linux-generic/include/odp/drv/plat/byteorder_types.h @@ -0,0 +1,80 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV byteorder + */ + +#ifndef ODPDRV_BYTEORDER_TYPES_H_ +#define ODPDRV_BYTEORDER_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __BYTE_ORDER__ +#error __BYTE_ORDER not defined! +#endif + +#ifndef __ORDER_BIG_ENDIAN__ +#error __BIG_ENDIAN not defined! +#endif + +#ifndef __ORDER_LITTLE_ENDIAN__ +#error __LITTLE_ENDIAN not defined! +#endif + +/* for use with type checkers such as sparse */ +#ifdef __CHECKER__ +/** @internal bitwise attribute */ +#define __odpdrv_bitwise __attribute__((bitwise)) +/** @internal force attribute */ +#define __odpdrv_force __attribute__((force)) +#else +/** @internal bitwise attribute */ +#define __odpdrv_bitwise +/** @internal force attribute */ +#define __odpdrv_force +#endif + +/** @addtogroup odpdrv_compiler_optim + * @{ + */ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + #define ODPDRV_LITTLE_ENDIAN 1 + #define ODPDRV_BIG_ENDIAN 0 + #define ODPDRV_BYTE_ORDER ODP_LITTLE_ENDIAN + #define ODPDRV_LITTLE_ENDIAN_BITFIELD +#else + #define ODPDRV_LITTLE_ENDIAN 0 + #define ODPDRV_BIG_ENDIAN 1 + #define ODPDRV_BYTE_ORDER ODP_BIG_ENDIAN + #define ODPDRV_BIG_ENDIAN_BITFIELD +#endif + +typedef uint16_t __odpdrv_bitwise odpdrv_u16le_t; +typedef uint16_t __odpdrv_bitwise odpdrv_u16be_t; + +typedef uint32_t __odpdrv_bitwise odpdrv_u32le_t; +typedef uint32_t __odpdrv_bitwise odpdrv_u32be_t; + +typedef uint64_t __odpdrv_bitwise odpdrv_u64le_t; +typedef uint64_t __odpdrv_bitwise odpdrv_u64be_t; + +typedef uint16_t __odpdrv_bitwise odpdrv_u16sum_t; +typedef uint32_t __odpdrv_bitwise odpdrv_u32sum_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif
commit 0e6bdb3fd61c818aed53827e96263fd14ed6edcc Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:12 2016 +0200
drv: adding byteorder.h
Based on API interface file.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/drv/spec/byteorder.h b/include/odp/drv/spec/byteorder.h new file mode 100644 index 0000000..d3f5d7e --- /dev/null +++ b/include/odp/drv/spec/byteorder.h @@ -0,0 +1,178 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV byteorder + */ + +#ifndef ODPDRV_BYTEORDER_H_ +#define ODPDRV_BYTEORDER_H_ +#include <odp/visibility_begin.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odpdrv_compiler_optim ODPDRV COMPILER / OPTIMIZATION + * Macros that check byte order and operations for byte order conversion. + * @{ + */ + +/** + * @def ODPDRV_BIG_ENDIAN + * Big endian byte order + * + * @def ODPDRV_LITTLE_ENDIAN + * Little endian byte order + * + * @def ODPDRV_BIG_ENDIAN_BITFIELD + * Big endian bit field + * + * @def ODPDRV_LITTLE_ENDIAN_BITFIELD + * Little endian bit field + * + * @def ODPDRV_BYTE_ORDER + * Selected byte order + */ + +/** + * @typedef odpdrv_u16le_t + * unsigned 16bit little endian + * + * @typedef odpdrv_u16be_t + * unsigned 16bit big endian + * + * @typedef odpdrv_u32le_t + * unsigned 32bit little endian + * + * @typedef odpdrv_u32be_t + * unsigned 32bit big endian + * + * @typedef odpdrv_u64le_t + * unsigned 64bit little endian + * + * @typedef odpdrv_u64be_t + * unsigned 64bit big endian + * + * @typedef odpdrv_u16sum_t + * unsigned 16bit bitwise + * + * @typedef odpdrv_u32sum_t + * unsigned 32bit bitwise + */ + +/* + * Big Endian -> CPU byte order: + */ + +/** + * Convert 16bit big endian to cpu native uint16_t + * @param be16 big endian 16bit + * @return cpu native uint16_t + */ +uint16_t odpdrv_be_to_cpu_16(odpdrv_u16be_t be16); + +/** + * Convert 32bit big endian to cpu native uint32_t + * @param be32 big endian 32bit + * @return cpu native uint32_t + */ +uint32_t odpdrv_be_to_cpu_32(odpdrv_u32be_t be32); + +/** + * Convert 64bit big endian to cpu native uint64_t + * @param be64 big endian 64bit + * @return cpu native uint64_t + */ +uint64_t odpdrv_be_to_cpu_64(odpdrv_u64be_t be64); + +/* + * CPU byte order -> Big Endian: + */ + +/** + * Convert cpu native uint16_t to 16bit big endian + * @param cpu16 uint16_t in cpu native format + * @return big endian 16bit + */ +odpdrv_u16be_t odpdrv_cpu_to_be_16(uint16_t cpu16); + +/** + * Convert cpu native uint32_t to 32bit big endian + * @param cpu32 uint32_t in cpu native format + * @return big endian 32bit + */ +odpdrv_u32be_t odpdrv_cpu_to_be_32(uint32_t cpu32); + +/** + * Convert cpu native uint64_t to 64bit big endian + * @param cpu64 uint64_t in cpu native format + * @return big endian 64bit + */ +odpdrv_u64be_t odpdrv_cpu_to_be_64(uint64_t cpu64); + +/* + * Little Endian -> CPU byte order: + */ + +/** + * Convert 16bit little endian to cpu native uint16_t + * @param le16 little endian 16bit + * @return cpu native uint16_t + */ +uint16_t odpdrv_le_to_cpu_16(odpdrv_u16le_t le16); + +/** + * Convert 32bit little endian to cpu native uint32_t + * @param le32 little endian 32bit + * @return cpu native uint32_t + */ +uint32_t odpdrv_le_to_cpu_32(odpdrv_u32le_t le32); + +/** + * Convert 64bit little endian to cpu native uint64_t + * @param le64 little endian 64bit + * @return cpu native uint64_t + */ +uint64_t odpdrv_le_to_cpu_64(odpdrv_u64le_t le64); + +/* + * CPU byte order -> Little Endian: + */ + +/** + * Convert cpu native uint16_t to 16bit little endian + * @param cpu16 uint16_t in cpu native format + * @return little endian 16bit + */ +odpdrv_u16le_t odpdrv_cpu_to_le_16(uint16_t cpu16); + +/** + * Convert cpu native uint32_t to 32bit little endian + * @param cpu32 uint32_t in cpu native format + * @return little endian 32bit + */ +odpdrv_u32le_t odpdrv_cpu_to_le_32(uint32_t cpu32); + +/** + * Convert cpu native uint64_t to 64bit little endian + * @param cpu64 uint64_t in cpu native format + * @return little endian 64bit + */ +odpdrv_u64le_t odpdrv_cpu_to_le_64(uint64_t cpu64); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include <odp/visibility_end.h> +#endif diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 053bd12..9fea4a7 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -60,3 +60,7 @@ odpapispecinclude_HEADERS = \ $(top_srcdir)/include/odp/api/spec/timer.h \ $(top_srcdir)/include/odp/api/spec/traffic_mngr.h \ $(top_srcdir)/include/odp/api/spec/version.h + +odpdrvspecincludedir= $(includedir)/odp/drv/spec +odpdrvspecinclude_HEADERS = \ + $(top_srcdir)/include/odp/drv/spec/byteorder.h
commit 44dc80798aa4fb92f60e1cd38f2f518b7e11946f Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:11 2016 +0200
linux-generic: cosmetic changes on byteorder files
To please check-patch before the copy to the drv interface.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h index 802a015..6b18eb3 100644 --- a/include/odp/api/spec/byteorder.h +++ b/include/odp/api/spec/byteorder.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */
- /** * @file * @@ -92,7 +91,6 @@ uint32_t odp_be_to_cpu_32(odp_u32be_t be32); */ uint64_t odp_be_to_cpu_64(odp_u64be_t be64);
- /* * CPU byte order -> Big Endian: */ @@ -118,7 +116,6 @@ odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32); */ odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64);
- /* * Little Endian -> CPU byte order: */ @@ -144,7 +141,6 @@ uint32_t odp_le_to_cpu_32(odp_u32le_t le32); */ uint64_t odp_le_to_cpu_64(odp_u64le_t le64);
- /* * CPU byte order -> Little Endian: */ diff --git a/platform/linux-generic/include/odp/api/byteorder.h b/platform/linux-generic/include/odp/api/byteorder.h index c347be0..df8e95b 100644 --- a/platform/linux-generic/include/odp/api/byteorder.h +++ b/platform/linux-generic/include/odp/api/byteorder.h @@ -52,7 +52,6 @@ static inline uint64_t odp_be_to_cpu_64(odp_u64be_t be64) #endif }
- static inline odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN @@ -80,7 +79,6 @@ static inline odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) #endif }
- static inline uint16_t odp_le_to_cpu_16(odp_u16le_t le16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN @@ -108,7 +106,6 @@ static inline uint64_t odp_le_to_cpu_64(odp_u64le_t le64) #endif }
- static inline odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h b/platform/linux-generic/include/odp/api/plat/byteorder_types.h index 679d4cf..d4bf3d6 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_types.h @@ -4,7 +4,6 @@ * SPDX-License-Identifier: BSD-3-Clause */
- /** * @file * @@ -30,7 +29,6 @@ extern "C" { #error __LITTLE_ENDIAN not defined! #endif
- /* for use with type checkers such as sparse */ #ifdef __CHECKER__ /** @internal bitwise attribute */ @@ -44,7 +42,6 @@ extern "C" { #define __odp_force #endif
- /** @addtogroup odp_compiler_optim * @{ */
commit 309aab7862f8047e96062853729ec709bade5ed6 Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:10 2016 +0200
linux-generic: moving the visibility files one step up
include/odp/api/visibility_begin.h and include/odp/api/visibility_end.h move one step up (in include/odp/) and can therefore be used on other interfaces.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h index cbe7d67..fdf8c29 100644 --- a/include/odp/api/spec/align.h +++ b/include/odp/api/spec/align.h @@ -13,7 +13,7 @@
#ifndef ODP_API_ALIGN_H_ #define ODP_API_ALIGN_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -75,5 +75,5 @@ extern "C" { } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h index 36c50cb..b8d992d 100644 --- a/include/odp/api/spec/atomic.h +++ b/include/odp/api/spec/atomic.h @@ -13,7 +13,7 @@
#ifndef ODP_API_ATOMIC_H_ #define ODP_API_ATOMIC_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -629,5 +629,5 @@ int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/barrier.h b/include/odp/api/spec/barrier.h index fbd1072..678d39a 100644 --- a/include/odp/api/spec/barrier.h +++ b/include/odp/api/spec/barrier.h @@ -13,7 +13,7 @@
#ifndef ODP_API_BARRIER_H_ #define ODP_API_BARRIER_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -64,5 +64,5 @@ void odp_barrier_wait(odp_barrier_t *barr); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h index 5c632b5..94829b3 100644 --- a/include/odp/api/spec/buffer.h +++ b/include/odp/api/spec/buffer.h @@ -13,7 +13,7 @@
#ifndef ODP_API_BUFFER_H_ #define ODP_API_BUFFER_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -169,5 +169,5 @@ uint64_t odp_buffer_to_u64(odp_buffer_t hdl); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h index 1018997..802a015 100644 --- a/include/odp/api/spec/byteorder.h +++ b/include/odp/api/spec/byteorder.h @@ -13,7 +13,7 @@
#ifndef ODP_API_BYTEORDER_H_ #define ODP_API_BYTEORDER_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -178,5 +178,5 @@ odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 523a8c4..189c91f 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -13,7 +13,7 @@
#ifndef ODP_API_CLASSIFY_H_ #define ODP_API_CLASSIFY_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -499,5 +499,5 @@ uint64_t odp_pmr_to_u64(odp_pmr_t hdl); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/compiler.h b/include/odp/api/spec/compiler.h index d271e90..c88350e 100644 --- a/include/odp/api/spec/compiler.h +++ b/include/odp/api/spec/compiler.h @@ -13,7 +13,7 @@
#ifndef ODP_API_COMPILER_H_ #define ODP_API_COMPILER_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -49,5 +49,5 @@ extern "C" { } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h index 2789511..0f47e47 100644 --- a/include/odp/api/spec/cpu.h +++ b/include/odp/api/spec/cpu.h @@ -13,7 +13,7 @@
#ifndef ODP_CPU_H_ #define ODP_CPU_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -177,5 +177,5 @@ void odp_cpu_pause(void); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/cpumask.h b/include/odp/api/spec/cpumask.h index 6e16fd0..22d8e8f 100644 --- a/include/odp/api/spec/cpumask.h +++ b/include/odp/api/spec/cpumask.h @@ -13,7 +13,7 @@
#ifndef ODP_API_CPUMASK_H_ #define ODP_API_CPUMASK_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -250,5 +250,5 @@ int odp_cpumask_all_available(odp_cpumask_t *mask); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index d8123e9..90c8f11 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -13,7 +13,7 @@
#ifndef ODP_API_CRYPTO_H_ #define ODP_API_CRYPTO_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -460,5 +460,5 @@ uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/debug.h b/include/odp/api/spec/debug.h index a49dff3..b3b170f 100644 --- a/include/odp/api/spec/debug.h +++ b/include/odp/api/spec/debug.h @@ -11,7 +11,7 @@
#ifndef ODP_API_DEBUG_H_ #define ODP_API_DEBUG_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -32,5 +32,5 @@ extern "C" { } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/errno.h b/include/odp/api/spec/errno.h index a1e7642..9b60a98 100644 --- a/include/odp/api/spec/errno.h +++ b/include/odp/api/spec/errno.h @@ -12,7 +12,7 @@
#ifndef ODP_ERRNO_H_ #define ODP_ERRNO_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -83,5 +83,5 @@ const char *odp_errno_str(int errnum); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index 082768f..fdfa52d 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.h @@ -13,7 +13,7 @@
#ifndef ODP_API_EVENT_H_ #define ODP_API_EVENT_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -83,5 +83,5 @@ void odp_event_free(odp_event_t event); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/hash.h b/include/odp/api/spec/hash.h index 07a0156..66b740e 100644 --- a/include/odp/api/spec/hash.h +++ b/include/odp/api/spec/hash.h @@ -12,7 +12,7 @@
#ifndef ODP_API_HASH_H_ #define ODP_API_HASH_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -96,5 +96,5 @@ int odp_hash_crc_gen64(const void *data, uint32_t data_len, } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h index ff5099c..82400f0 100644 --- a/include/odp/api/spec/hints.h +++ b/include/odp/api/spec/hints.h @@ -13,7 +13,7 @@
#ifndef ODP_API_HINTS_H_ #define ODP_API_HINTS_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -114,5 +114,5 @@ extern "C" { } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index fec6774..154cdf8 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -21,7 +21,7 @@
#ifndef ODP_API_INIT_H_ #define ODP_API_INIT_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -277,5 +277,5 @@ int odp_term_local(void); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 522adb2..4a14f2d 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -13,7 +13,7 @@
#ifndef ODP_API_PACKET_H_ #define ODP_API_PACKET_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -1402,5 +1402,5 @@ uint64_t odp_packet_seg_to_u64(odp_packet_seg_t hdl); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h index c2998c1..377b75b 100644 --- a/include/odp/api/spec/packet_flags.h +++ b/include/odp/api/spec/packet_flags.h @@ -13,7 +13,7 @@
#ifndef ODP_API_PACKET_FLAGS_H_ #define ODP_API_PACKET_FLAGS_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -494,5 +494,5 @@ void odp_packet_has_ts_clr(odp_packet_t pkt); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index c7373fd..d46e405 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -13,7 +13,7 @@
#ifndef ODP_API_PACKET_IO_H_ #define ODP_API_PACKET_IO_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -1074,5 +1074,5 @@ odp_time_t odp_pktin_ts_from_ns(odp_pktio_t pktio, uint64_t ns); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/packet_io_stats.h b/include/odp/api/spec/packet_io_stats.h index 73cf704..299ecd0 100644 --- a/include/odp/api/spec/packet_io_stats.h +++ b/include/odp/api/spec/packet_io_stats.h @@ -12,7 +12,7 @@
#ifndef ODP_API_PACKET_IO_STATS_H_ #define ODP_API_PACKET_IO_STATS_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -139,5 +139,5 @@ int odp_pktio_stats_reset(odp_pktio_t pktio); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index b31b6aa..c80c98a 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -13,7 +13,7 @@
#ifndef ODP_API_POOL_H_ #define ODP_API_POOL_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -327,5 +327,5 @@ void odp_pool_param_init(odp_pool_param_t *param); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 92822da..31dc9f5 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -13,7 +13,7 @@
#ifndef ODP_API_QUEUE_H_ #define ODP_API_QUEUE_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -413,5 +413,5 @@ int odp_queue_info(odp_queue_t queue, odp_queue_info_t *info); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/random.h b/include/odp/api/spec/random.h index db77630..00fa15b 100644 --- a/include/odp/api/spec/random.h +++ b/include/odp/api/spec/random.h @@ -13,7 +13,7 @@
#ifndef ODP_API_RANDOM_H_ #define ODP_API_RANDOM_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -45,5 +45,5 @@ int32_t odp_random_data(uint8_t *buf, int32_t size, odp_bool_t use_entropy); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h index 2624b56..ff8a3f2 100644 --- a/include/odp/api/spec/rwlock.h +++ b/include/odp/api/spec/rwlock.h @@ -6,7 +6,7 @@
#ifndef ODP_API_RWLOCK_H_ #define ODP_API_RWLOCK_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
/** * @file @@ -100,5 +100,5 @@ void odp_rwlock_write_unlock(odp_rwlock_t *rwlock); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif /* ODP_RWLOCK_H_ */ diff --git a/include/odp/api/spec/rwlock_recursive.h b/include/odp/api/spec/rwlock_recursive.h index 9d50f20..1c19c72 100644 --- a/include/odp/api/spec/rwlock_recursive.h +++ b/include/odp/api/spec/rwlock_recursive.h @@ -12,7 +12,7 @@
#ifndef ODP_API_RWLOCK_RECURSIVE_H_ #define ODP_API_RWLOCK_RECURSIVE_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -118,5 +118,5 @@ void odp_rwlock_recursive_write_unlock(odp_rwlock_recursive_t *lock); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index f8fed17..d924da2 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -13,7 +13,7 @@
#ifndef ODP_API_SCHEDULE_H_ #define ODP_API_SCHEDULE_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -375,5 +375,5 @@ void odp_schedule_order_unlock(unsigned lock_index); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index b7c1980..8a4e42c 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_types.h @@ -12,7 +12,7 @@
#ifndef ODP_API_SCHEDULE_TYPES_H_ #define ODP_API_SCHEDULE_TYPES_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -157,5 +157,5 @@ typedef struct odp_schedule_param_t { } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h index fbe0fde..8c76807 100644 --- a/include/odp/api/spec/shared_memory.h +++ b/include/odp/api/spec/shared_memory.h @@ -13,7 +13,7 @@
#ifndef ODP_API_SHARED_MEMORY_H_ #define ODP_API_SHARED_MEMORY_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -187,5 +187,5 @@ uint64_t odp_shm_to_u64(odp_shm_t hdl); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/spinlock.h b/include/odp/api/spec/spinlock.h index 8263171..87f9b83 100644 --- a/include/odp/api/spec/spinlock.h +++ b/include/odp/api/spec/spinlock.h @@ -13,7 +13,7 @@
#ifndef ODP_API_SPINLOCK_H_ #define ODP_API_SPINLOCK_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -89,5 +89,5 @@ int odp_spinlock_is_locked(odp_spinlock_t *splock); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/spinlock_recursive.h b/include/odp/api/spec/spinlock_recursive.h index 07829fd..c9c7ddb 100644 --- a/include/odp/api/spec/spinlock_recursive.h +++ b/include/odp/api/spec/spinlock_recursive.h @@ -12,7 +12,7 @@
#ifndef ODP_API_SPINLOCK_RECURSIVE_H_ #define ODP_API_SPINLOCK_RECURSIVE_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -83,5 +83,5 @@ int odp_spinlock_recursive_is_locked(odp_spinlock_recursive_t *lock); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/std_clib.h b/include/odp/api/spec/std_clib.h index 772732c..33e9db5 100644 --- a/include/odp/api/spec/std_clib.h +++ b/include/odp/api/spec/std_clib.h @@ -12,7 +12,7 @@
#ifndef ODP_API_STD_CLIB_H_ #define ODP_API_STD_CLIB_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -80,5 +80,5 @@ int odp_memcmp(const void *ptr1, const void *ptr2, size_t num); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h index 47018d5..ec6a6df 100644 --- a/include/odp/api/spec/std_types.h +++ b/include/odp/api/spec/std_types.h @@ -14,7 +14,7 @@
#ifndef ODP_API_STD_TYPES_H_ #define ODP_API_STD_TYPES_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -39,5 +39,5 @@ extern "C" { } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/sync.h b/include/odp/api/spec/sync.h index 84b7cb9..b48e0ab 100644 --- a/include/odp/api/spec/sync.h +++ b/include/odp/api/spec/sync.h @@ -13,7 +13,7 @@
#ifndef ODP_API_SYNC_H_ #define ODP_API_SYNC_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -88,5 +88,5 @@ void odp_mb_full(void); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h index c5a5fd0..0bb4f1f 100644 --- a/include/odp/api/spec/system_info.h +++ b/include/odp/api/spec/system_info.h @@ -13,7 +13,7 @@
#ifndef ODP_API_SYSTEM_INFO_H_ #define ODP_API_SYSTEM_INFO_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -52,5 +52,5 @@ int odp_sys_cache_line_size(void); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h index 6e2a817..689ba59 100644 --- a/include/odp/api/spec/thread.h +++ b/include/odp/api/spec/thread.h @@ -13,7 +13,7 @@
#ifndef ODP_API_THREAD_H_ #define ODP_API_THREAD_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -110,5 +110,5 @@ odp_thread_type_t odp_thread_type(void); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/thrmask.h b/include/odp/api/spec/thrmask.h index 73f3866..3986769 100644 --- a/include/odp/api/spec/thrmask.h +++ b/include/odp/api/spec/thrmask.h @@ -12,7 +12,7 @@
#ifndef ODP_API_THRMASK_H_ #define ODP_API_THRMASK_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -237,5 +237,5 @@ int odp_thrmask_control(odp_thrmask_t *mask); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/ticketlock.h b/include/odp/api/spec/ticketlock.h index d485565..b23253b 100644 --- a/include/odp/api/spec/ticketlock.h +++ b/include/odp/api/spec/ticketlock.h @@ -13,7 +13,7 @@
#ifndef ODP_API_TICKETLOCK_H_ #define ODP_API_TICKETLOCK_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -88,5 +88,5 @@ int odp_ticketlock_is_locked(odp_ticketlock_t *tklock); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/time.h b/include/odp/api/spec/time.h index a78fc2c..fcc94c9 100644 --- a/include/odp/api/spec/time.h +++ b/include/odp/api/spec/time.h @@ -13,7 +13,7 @@
#ifndef ODP_API_TIME_H_ #define ODP_API_TIME_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -178,5 +178,5 @@ uint64_t odp_time_to_u64(odp_time_t time); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 3f8fdd4..df37189 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -13,7 +13,7 @@
#ifndef ODP_API_TIMER_H_ #define ODP_API_TIMER_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -413,5 +413,5 @@ uint64_t odp_timeout_to_u64(odp_timeout_t hdl); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h index 3473648..71198bb 100644 --- a/include/odp/api/spec/traffic_mngr.h +++ b/include/odp/api/spec/traffic_mngr.h @@ -6,7 +6,7 @@
#ifndef ODP_TRAFFIC_MNGR_H_ #define ODP_TRAFFIC_MNGR_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -1961,5 +1961,5 @@ void odp_tm_stats_print(odp_tm_t odp_tm); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/include/odp/api/spec/version.h b/include/odp/api/spec/version.h index aa3f3ab..b249c1d 100644 --- a/include/odp/api/spec/version.h +++ b/include/odp/api/spec/version.h @@ -13,7 +13,7 @@
#ifndef ODP_API_VERSION_H_ #define ODP_API_VERSION_H_ -#include <odp/api/visibility_begin.h> +#include <odp/visibility_begin.h>
#ifdef __cplusplus extern "C" { @@ -103,5 +103,5 @@ const char *odp_version_impl_str(void); } #endif
-#include <odp/api/visibility_end.h> +#include <odp/visibility_end.h> #endif diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 9ea6afa..991ccd2 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -11,6 +11,11 @@ include_HEADERS = \ $(top_srcdir)/include/odp.h \ $(top_srcdir)/include/odp_api.h
+odpincludedir= $(includedir)/odp +odpinclude_HEADERS = \ + $(srcdir)/include/odp/visibility_begin.h \ + $(srcdir)/include/odp/visibility_end.h + odpapiincludedir= $(includedir)/odp/api odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/align.h \ @@ -54,8 +59,6 @@ odpapiinclude_HEADERS = \ $(srcdir)/include/odp/api/timer.h \ $(srcdir)/include/odp/api/traffic_mngr.h \ $(srcdir)/include/odp/api/version.h \ - $(srcdir)/include/odp/api/visibility_begin.h \ - $(srcdir)/include/odp/api/visibility_end.h \ $(srcdir)/arch/@ARCH_DIR@/odp/api/cpu_arch.h
odpapiplatincludedir= $(includedir)/odp/api/plat diff --git a/platform/linux-generic/include/odp/api/visibility_begin.h b/platform/linux-generic/include/odp/visibility_begin.h similarity index 100% rename from platform/linux-generic/include/odp/api/visibility_begin.h rename to platform/linux-generic/include/odp/visibility_begin.h diff --git a/platform/linux-generic/include/odp/api/visibility_end.h b/platform/linux-generic/include/odp/visibility_end.h similarity index 100% rename from platform/linux-generic/include/odp/api/visibility_end.h rename to platform/linux-generic/include/odp/visibility_end.h
commit 70dc2963eaf9e8dbd528607fdd08ac6204c5c13c Author: Christophe Milard christophe.milard@linaro.org Date: Thu Jul 21 14:06:09 2016 +0200
linux-generic: Makefile: reintroducing lost change for drv
The change done for commit id 1fcd2369be88a6f4f7a7a93e9bb315d0e65ab128 in the Makefile, and delated after is reintroduced here.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Mike Holmes mike.holmes@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index c8fd8cb..9ea6afa 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -88,6 +88,10 @@ odpapiplatinclude_HEADERS = \ $(srcdir)/include/odp/api/plat/traffic_mngr_types.h \ $(srcdir)/include/odp/api/plat/version_types.h
+odpdrvincludedir = $(includedir)/odp/drv +odpdrvinclude_HEADERS = \ + $(srcdir)/include/odp/drv/compiler.h + noinst_HEADERS = \ ${srcdir}/include/odp_align_internal.h \ ${srcdir}/include/odp_atomic_internal.h \
-----------------------------------------------------------------------
Summary of changes: include/odp/api/spec/align.h | 4 +- include/odp/api/spec/atomic.h | 5 +- include/odp/api/spec/barrier.h | 4 +- include/odp/api/spec/buffer.h | 4 +- include/odp/api/spec/byteorder.h | 8 +- include/odp/api/spec/classification.h | 4 +- include/odp/api/spec/compiler.h | 4 +- include/odp/api/spec/cpu.h | 4 +- include/odp/api/spec/cpumask.h | 4 +- include/odp/api/spec/crypto.h | 4 +- include/odp/api/spec/debug.h | 4 +- include/odp/api/spec/errno.h | 4 +- include/odp/api/spec/event.h | 4 +- include/odp/api/spec/hash.h | 4 +- include/odp/api/spec/hints.h | 4 +- include/odp/api/spec/init.h | 4 +- include/odp/api/spec/packet.h | 4 +- include/odp/api/spec/packet_flags.h | 4 +- include/odp/api/spec/packet_io.h | 4 +- include/odp/api/spec/packet_io_stats.h | 4 +- include/odp/api/spec/pool.h | 4 +- include/odp/api/spec/queue.h | 4 +- include/odp/api/spec/random.h | 4 +- include/odp/api/spec/rwlock.h | 4 +- include/odp/api/spec/rwlock_recursive.h | 4 +- include/odp/api/spec/schedule.h | 4 +- include/odp/api/spec/schedule_types.h | 4 +- include/odp/api/spec/shared_memory.h | 4 +- include/odp/api/spec/spinlock.h | 11 +- include/odp/api/spec/spinlock_recursive.h | 4 +- include/odp/api/spec/std_clib.h | 4 +- include/odp/api/spec/std_types.h | 4 +- include/odp/api/spec/sync.h | 5 +- include/odp/api/spec/system_info.h | 4 +- include/odp/api/spec/thread.h | 4 +- include/odp/api/spec/thrmask.h | 4 +- include/odp/api/spec/ticketlock.h | 4 +- include/odp/api/spec/time.h | 4 +- include/odp/api/spec/timer.h | 4 +- include/odp/api/spec/traffic_mngr.h | 4 +- include/odp/api/spec/version.h | 4 +- include/odp/{api => drv}/spec/align.h | 31 ++-- include/odp/{api => drv}/spec/atomic.h | 203 +++++++++++---------- include/odp/{api => drv}/spec/byteorder.h | 68 ++++--- include/odp/{api => drv}/spec/spinlock.h | 37 ++-- include/odp/{api => drv}/spec/sync.h | 47 +++-- include/odp_drv.h | 5 + platform/Makefile.inc | 10 + platform/linux-generic/Makefile.am | 25 ++- .../linux-generic/{odp_atomic.c => drv_atomic.c} | 6 +- .../{odp_spinlock.c => drv_spinlock.c} | 19 +- platform/linux-generic/include/odp/api/byteorder.h | 3 - .../include/odp/api/plat/atomic_types.h | 1 - .../include/odp/api/plat/byteorder_types.h | 3 - platform/linux-generic/include/odp/drv/align.h | 60 ++++++ .../include/odp/{api => drv}/atomic.h | 178 +++++++++--------- platform/linux-generic/include/odp/drv/byteorder.h | 146 +++++++++++++++ .../include/odp/{api => drv}/plat/atomic_types.h | 25 ++- .../include/odp/drv/plat/byteorder_types.h | 80 ++++++++ .../include/odp/drv/plat/spinlock_types.h | 33 ++++ .../odp/{api/packet_io_stats.h => drv/spinlock.h} | 10 +- .../linux-generic/include/odp/{api => drv}/sync.h | 18 +- .../include/odp/{api => }/visibility_begin.h | 0 .../include/odp/{api => }/visibility_end.h | 0 platform/linux-generic/odp_spinlock.c | 4 - 65 files changed, 757 insertions(+), 432 deletions(-) copy include/odp/{api => drv}/spec/align.h (63%) copy include/odp/{api => drv}/spec/atomic.h (69%) copy include/odp/{api => drv}/spec/byteorder.h (66%) copy include/odp/{api => drv}/spec/spinlock.h (60%) copy include/odp/{api => drv}/spec/sync.h (59%) copy platform/linux-generic/{odp_atomic.c => drv_atomic.c} (73%) copy platform/linux-generic/{odp_spinlock.c => drv_spinlock.c} (64%) create mode 100644 platform/linux-generic/include/odp/drv/align.h copy platform/linux-generic/include/odp/{api => drv}/atomic.h (54%) create mode 100644 platform/linux-generic/include/odp/drv/byteorder.h copy platform/linux-generic/include/odp/{api => drv}/plat/atomic_types.h (76%) create mode 100644 platform/linux-generic/include/odp/drv/plat/byteorder_types.h create mode 100644 platform/linux-generic/include/odp/drv/plat/spinlock_types.h copy platform/linux-generic/include/odp/{api/packet_io_stats.h => drv/spinlock.h} (57%) copy platform/linux-generic/include/odp/{api => drv}/sync.h (53%) rename platform/linux-generic/include/odp/{api => }/visibility_begin.h (100%) rename platform/linux-generic/include/odp/{api => }/visibility_end.h (100%)
hooks/post-receive