Signed-off-by: Jerin Jacob <jerin.ja...@caviumnetworks.com> --- include/odp/api/rwlock.h | 11 +---- platform/linux-generic/Makefile.am | 1 + .../linux-generic/include/odp/plat/rwlock_types.h | 48 ++++++++++++++++++++++ platform/linux-generic/include/odp/rwlock.h | 2 + 4 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 platform/linux-generic/include/odp/plat/rwlock_types.h
diff --git a/include/odp/api/rwlock.h b/include/odp/api/rwlock.h index 950b83a..d730a70 100644 --- a/include/odp/api/rwlock.h +++ b/include/odp/api/rwlock.h @@ -13,8 +13,6 @@ * ODP RW Locks */ -#include <odp/atomic.h> - #ifdef __cplusplus extern "C" { #endif @@ -29,14 +27,9 @@ extern "C" { */ /** - * The odp_rwlock_t type. + * @typedef odp_rwlock_t + * ODP rwlock */ -typedef struct { - odp_atomic_u32_t cnt; /**< @private lock count - 0 lock not taken - -1 write lock taken - >0 read lock(s) taken */ -} odp_rwlock_t; /** diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 9749df6..200523c 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -58,6 +58,7 @@ odpplatinclude_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/odp/plat/packet_io_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/pool_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/queue_types.h \ + $(top_srcdir)/platform/linux-generic/include/odp/plat/rwlock_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/schedule_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h \ $(top_srcdir)/platform/linux-generic/include/odp/plat/spinlock_types.h \ diff --git a/platform/linux-generic/include/odp/plat/rwlock_types.h b/platform/linux-generic/include/odp/plat/rwlock_types.h new file mode 100644 index 0000000..bd46e57 --- /dev/null +++ b/platform/linux-generic/include/odp/plat/rwlock_types.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP rwlock + */ + +#ifndef ODP_RWLOCK_TYPES_H_ +#define ODP_RWLOCK_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/atomic.h> + +/** + * @internal + * ODP rwlock + */ +struct odp_rwlock_s { + odp_atomic_u32_t cnt; /**< lock count + 0 lock not taken + -1 write lock taken + >0 read lock(s) taken */ +}; + +/** @addtogroup odp_synchronizers + * @{ + */ + +typedef struct odp_rwlock_s odp_rwlock_t; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/rwlock.h b/platform/linux-generic/include/odp/rwlock.h index 06320f6..ca88ff7 100644 --- a/platform/linux-generic/include/odp/rwlock.h +++ b/platform/linux-generic/include/odp/rwlock.h @@ -17,6 +17,8 @@ extern "C" { #endif +#include <odp/plat/rwlock_types.h> + /** @ingroup odp_synchronizers * @{ */ -- 2.1.0 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp