diff mbox series

[18/29] linux-gen, include: switch atomic.h to api+abi

Message ID 20171023111057.6328-19-dmitry.ereminsolenikov@linaro.org
State Superseded
Headers show
Series restructure headers for ABI-compat/platform-optimized modes | expand

Commit Message

Dmitry Eremin-Solenikov Oct. 23, 2017, 11:10 a.m. UTC
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
 include/Makefile.am                                |  1 +
 include/odp/api/atomic.h                           | 28 +++++++++++++++
 platform/linux-generic/Makefile.am                 |  3 +-
 .../odp/api/abi/atomic.h}                          | 14 ++++++--
 platform/linux-generic/include/odp/api/atomic.h    | 42 ----------------------
 .../linux-generic/include/odp/api/ticketlock.h     |  1 +
 platform/linux-generic/odp_atomic.c                |  1 +
 7 files changed, 44 insertions(+), 46 deletions(-)
 create mode 100644 include/odp/api/atomic.h
 rename platform/linux-generic/{include/odp/api/plat/atomic_types.h => include-abi/odp/api/abi/atomic.h} (86%)
 delete mode 100644 platform/linux-generic/include/odp/api/atomic.h

-- 
2.14.2
diff mbox series

Patch

diff --git a/include/Makefile.am b/include/Makefile.am
index 946b7c07cf73..d1eb26bc59c2 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,6 +5,7 @@  include_HEADERS = \
 
 odpapiincludedir= $(includedir)/odp/api/
 odpapiinclude_HEADERS = \
+	odp/api/atomic.h \
 	odp/api/barrier.h \
 	odp/api/buffer.h \
 	odp/api/cpumask.h \
diff --git a/include/odp/api/atomic.h b/include/odp/api/atomic.h
new file mode 100644
index 000000000000..8e515ec6f736
--- /dev/null
+++ b/include/odp/api/atomic.h
@@ -0,0 +1,28 @@ 
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP atomic operations
+ */
+
+#ifndef ODP_API_ATOMIC_H_
+#define ODP_API_ATOMIC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/abi/atomic.h>
+
+#include <odp/api/spec/atomic.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 1516f8ee7aee..304ca86862f3 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -20,7 +20,6 @@  odpinclude_HEADERS = \
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
 		  include/odp/api/align.h \
-		  include/odp/api/atomic.h \
 		  include/odp/api/byteorder.h \
 		  include/odp/api/chksum.h \
 		  include/odp/api/classification.h \
@@ -47,7 +46,6 @@  odpapiinclude_HEADERS = \
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
 		  include/odp/api/plat/atomic_inlines.h \
-		  include/odp/api/plat/atomic_types.h \
 		  include/odp/api/plat/byteorder_inlines.h \
 		  include/odp/api/plat/byteorder_types.h \
 		  include/odp/api/plat/packet_flag_inlines.h \
@@ -68,6 +66,7 @@  nodist_odpapiplatinclude_HEADERS = \
 if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
+		  include-abi/odp/api/abi/atomic.h \
 		  include-abi/odp/api/abi/barrier.h \
 		  include-abi/odp/api/abi/buffer.h \
 		  include-abi/odp/api/abi/classification.h \
diff --git a/platform/linux-generic/include/odp/api/plat/atomic_types.h b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
similarity index 86%
rename from platform/linux-generic/include/odp/api/plat/atomic_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/atomic.h
index c0803bf11f63..0b7b254ced23 100644
--- a/platform/linux-generic/include/odp/api/plat/atomic_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
@@ -10,8 +10,8 @@ 
  * ODP atomic operations
  */
 
-#ifndef ODP_ATOMIC_TYPES_H_
-#define ODP_ATOMIC_TYPES_H_
+#ifndef ODP_API_ABI_ATOMIC_H_
+#define ODP_API_ABI_ATOMIC_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -59,6 +59,16 @@  typedef struct odp_atomic_u64_s odp_atomic_u64_t;
 
 typedef struct odp_atomic_u32_s odp_atomic_u32_t;
 
+/** @ingroup odp_atomic
+ *  @{
+ */
+
+#include <odp/api/plat/static_inline.h>
+#include <odp/api/plat/atomic_inlines.h>
+
+/**
+ * @}
+ */
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/include/odp/api/atomic.h b/platform/linux-generic/include/odp/api/atomic.h
deleted file mode 100644
index 7886cb4ea382..000000000000
--- a/platform/linux-generic/include/odp/api/atomic.h
+++ /dev/null
@@ -1,42 +0,0 @@ 
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:     BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP atomic operations
- */
-
-#ifndef ODP_PLAT_ATOMIC_H_
-#define ODP_PLAT_ATOMIC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <odp/api/align.h>
-#include <odp/api/plat/atomic_types.h>
-
-/** @ingroup odp_atomic
- *  @{
- */
-
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/atomic_inlines.h>
-#endif
-
-/**
- * @}
- */
-
-#include <odp/api/spec/atomic.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/platform/linux-generic/include/odp/api/ticketlock.h b/platform/linux-generic/include/odp/api/ticketlock.h
index e0f5d81fd6ed..ca12cc37cf9f 100644
--- a/platform/linux-generic/include/odp/api/ticketlock.h
+++ b/platform/linux-generic/include/odp/api/ticketlock.h
@@ -19,6 +19,7 @@  extern "C" {
 
 #include <odp/api/plat/ticketlock_types.h>
 
+#include <odp/api/plat/static_inline.h>
 #if ODP_ABI_COMPAT == 0
 #include <odp/api/plat/ticketlock_inlines.h>
 #endif
diff --git a/platform/linux-generic/odp_atomic.c b/platform/linux-generic/odp_atomic.c
index 53123b675595..1d76caf2b82f 100644
--- a/platform/linux-generic/odp_atomic.c
+++ b/platform/linux-generic/odp_atomic.c
@@ -7,6 +7,7 @@ 
 #include "config.h"
 
 #include <odp/api/atomic.h>
+#include <odp/api/plat/static_inline.h>
 #if ODP_ABI_COMPAT == 1
 #include <odp/api/plat/atomic_inlines.h>
 #endif