diff mbox

[RFC,14/17] Split out platform-specific part of odp_rwlock.h

Message ID 1398685276-4610-15-git-send-email-taras.kondratiuk@linaro.org
State RFC
Headers show

Commit Message

Taras Kondratiuk April 28, 2014, 11:41 a.m. UTC
---
 include/odp_rwlock.h                             |    9 +++-----
 platform/linux-generic/include/plat/odp_rwlock.h |   26 ++++++++++++++++++++++
 2 files changed, 29 insertions(+), 6 deletions(-)
 create mode 100644 platform/linux-generic/include/plat/odp_rwlock.h
diff mbox

Patch

diff --git a/include/odp_rwlock.h b/include/odp_rwlock.h
index 252ebb2..ee785fc 100644
--- a/include/odp_rwlock.h
+++ b/include/odp_rwlock.h
@@ -17,15 +17,12 @@ 
 extern "C" {
 #endif
 
+#include <plat/odp_rwlock.h>
+
 /**
  * The odp_rwlock_t type.
- * write lock count is -1,
- * read lock count > 0
  */
-typedef struct {
-	volatile int32_t cnt; /**< -1 Write lock,
-				> 0 for Read lock. */
-} odp_rwlock_t;
+typedef plat_odp_rwlock_t odp_rwlock_t;
 
 
 /**
diff --git a/platform/linux-generic/include/plat/odp_rwlock.h b/platform/linux-generic/include/plat/odp_rwlock.h
new file mode 100644
index 0000000..fc12d05
--- /dev/null
+++ b/platform/linux-generic/include/plat/odp_rwlock.h
@@ -0,0 +1,26 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_RWLOCK_H_
+#error This file should be included only into corresponding top level header
+#else
+
+/**
+ * @file
+ *
+ * ODP RW Locks
+ */
+
+/**
+ * write lock count is -1,
+ * read lock count > 0
+ */
+typedef struct {
+	volatile int32_t cnt; /**< -1 Write lock,
+				> 0 for Read lock. */
+} plat_odp_rwlock_t;
+
+#endif /* ODP_RWLOCK_H_ */