diff options
author | Jerin Jacob <jerin.jacob@caviumnetworks.com> | 2015-03-18 19:41:34 +0530 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-03-24 13:01:22 +0300 |
commit | 7ec392ceeeb0617998beebaeeb7f01236b013055 (patch) | |
tree | d6f6b7118191b61b2083dd7647955d2e6e53fb24 /platform/linux-generic | |
parent | 432f182cab9cd9fa927d9ba146b55bb06eadadde (diff) |
rwlock: allow platform to override odp_rwlock_t
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Bala Manoharan<bala.manoharan@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/Makefile.am | 1 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/plat/rwlock_types.h | 48 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/rwlock.h | 2 |
3 files changed, 51 insertions, 0 deletions
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 9749df6bc..200523c66 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 000000000..bd46e5722 --- /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 06320f659..ca88ff7db 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 * @{ */ |