aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp/plat/rwlock_types.h
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2015-03-18 19:41:34 +0530
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-03-24 13:01:22 +0300
commit7ec392ceeeb0617998beebaeeb7f01236b013055 (patch)
treed6f6b7118191b61b2083dd7647955d2e6e53fb24 /platform/linux-generic/include/odp/plat/rwlock_types.h
parent432f182cab9cd9fa927d9ba146b55bb06eadadde (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/include/odp/plat/rwlock_types.h')
-rw-r--r--platform/linux-generic/include/odp/plat/rwlock_types.h48
1 files changed, 48 insertions, 0 deletions
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