[v10,22/30] linux-gen, include: switch ticketlock.h to api+abi

Message ID 20171027125014.27313-23-dmitry.ereminsolenikov@linaro.org
State New
Headers show
Series
  • restructure headers for ABI-compat/platform-optimized modes
Related show

Commit Message

Dmitry Eremin-Solenikov Oct. 27, 2017, 12:50 p.m.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
 include/Makefile.am                                 |  1 +
 .../include => include}/odp/api/ticketlock.h        | 11 +++--------
 platform/linux-generic/Makefile.am                  |  7 +++----
 .../odp/api/abi/ticketlock.h}                       | 21 ++++++++++++++++-----
 .../include/odp/api/plat/ticketlock_inlines.h       | 20 --------------------
 platform/linux-generic/odp_queue_scalable.c         |  1 +
 platform/linux-generic/odp_ticketlock.c             |  4 +++-
 7 files changed, 27 insertions(+), 38 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/ticketlock.h (54%)
 rename platform/linux-generic/{include/odp/api/plat/ticketlock_types.h => include-abi/odp/api/abi/ticketlock.h} (52%)

-- 
2.14.2

Patch

diff --git a/include/Makefile.am b/include/Makefile.am
index 4a9c3efe674a..617aa4a6e67a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -27,6 +27,7 @@  odpapiinclude_HEADERS = \
 	odp/api/sync.h \
 	odp/api/thread.h \
 	odp/api/thrmask.h \
+	odp/api/ticketlock.h \
 	odp/api/time.h \
 	odp/api/timer.h \
 	odp/api/traffic_mngr.h \
diff --git a/platform/linux-generic/include/odp/api/ticketlock.h b/include/odp/api/ticketlock.h
similarity index 54%
rename from platform/linux-generic/include/odp/api/ticketlock.h
rename to include/odp/api/ticketlock.h
index ca12cc37cf9f..d875c0e34e76 100644
--- a/platform/linux-generic/include/odp/api/ticketlock.h
+++ b/include/odp/api/ticketlock.h
@@ -10,19 +10,14 @@ 
  * ODP ticketlock
  */
 
-#ifndef ODP_PLAT_TICKETLOCK_H_
-#define ODP_PLAT_TICKETLOCK_H_
+#ifndef ODP_API_TICKETLOCK_H_
+#define ODP_API_TICKETLOCK_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#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
+#include <odp/api/abi/ticketlock.h>
 
 #include <odp/api/spec/ticketlock.h>
 
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 69ccd8e0b978..3aee7ce6340e 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -37,8 +37,7 @@  odpapiinclude_HEADERS = \
 		  include/odp/api/packet_io_stats.h \
 		  include/odp/api/random.h \
 		  include/odp/api/support.h \
-		  include/odp/api/system_info.h \
-		  include/odp/api/ticketlock.h
+		  include/odp/api/system_info.h
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
@@ -53,8 +52,7 @@  odpapiplatinclude_HEADERS = \
 		  include/odp/api/plat/strong_types.h \
 		  include/odp/api/plat/sync_inlines.h \
 		  include/odp/api/plat/ticketlock_inlines.h \
-		  include/odp/api/plat/ticketlock_inlines_api.h \
-		  include/odp/api/plat/ticketlock_types.h
+		  include/odp/api/plat/ticketlock_inlines_api.h
 
 nodist_odpapiplatinclude_HEADERS = \
 		  include/odp/api/plat/static_inline.h
@@ -87,6 +85,7 @@  odpapiabiarchinclude_HEADERS = \
 		  include-abi/odp/api/abi/sync.h \
 		  include-abi/odp/api/abi/thread.h \
 		  include-abi/odp/api/abi/thrmask.h \
+		  include-abi/odp/api/abi/ticketlock.h \
 		  include-abi/odp/api/abi/time.h \
 		  include-abi/odp/api/abi/timer.h \
 		  include-abi/odp/api/abi/traffic_mngr.h \
diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
similarity index 52%
rename from platform/linux-generic/include/odp/api/plat/ticketlock_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
index 81d479d61a61..958184be6907 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
@@ -11,8 +11,8 @@ 
  * ODP ticketlock
  */
 
-#ifndef ODP_TICKETLOCK_TYPES_H_
-#define ODP_TICKETLOCK_TYPES_H_
+#ifndef ODP_API_ABI_TICKETLOCK_H_
+#define ODP_API_ABI_TICKETLOCK_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,13 +20,24 @@  extern "C" {
 
 #include <odp/api/atomic.h>
 
+/** @ingroup odp_locks
+ *  @{
+ */
+
 /** @internal */
-struct odp_ticketlock_s {
+typedef struct odp_ticketlock_s {
 	odp_atomic_u32_t  next_ticket; /**< Next ticket */
 	odp_atomic_u32_t  cur_ticket;  /**< Current ticket */
-};
+} odp_ticketlock_t;
+
+/* Include inlined versions of API functions */
+#include <odp/api/plat/static_inline.h>
+#include <odp/api/plat/ticketlock_inlines.h>
+#include <odp/api/plat/ticketlock_inlines_api.h>
 
-typedef struct odp_ticketlock_s odp_ticketlock_t;
+/**
+ * @}
+ */
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
index ecbea7c4d611..185d77de015f 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
@@ -14,10 +14,6 @@ 
 #define _ODP_PLAT_TICKETLOCK_INLINES_H_
 
 #include <odp/api/atomic.h>
-#include <odp/api/sync.h>
-#include <odp/api/cpu.h>
-
-#include <odp/api/plat/ticketlock_types.h>
 
 /** @internal
  * Acquire ticket lock.
@@ -111,20 +107,4 @@  static inline int _odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock)
 		odp_atomic_load_u32(&ticketlock->next_ticket);
 }
 
-/* Include inlined versions of API functions */
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-
-/** @ingroup odp_locks
- *  @{
- */
-
-#include <odp/api/plat/ticketlock_inlines_api.h>
-
-/**
- * @}
- */
-
-#endif
-
 #endif
diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c
index 07201ce7b5f7..09413e80314e 100644
--- a/platform/linux-generic/odp_queue_scalable.c
+++ b/platform/linux-generic/odp_queue_scalable.c
@@ -8,6 +8,7 @@ 
 #include <config.h>
 
 #include <odp/api/hints.h>
+#include <odp/api/ticketlock.h>
 #include <odp/api/plat/ticketlock_inlines.h>
 #include <odp/api/queue.h>
 #include <odp/api/schedule.h>
diff --git a/platform/linux-generic/odp_ticketlock.c b/platform/linux-generic/odp_ticketlock.c
index 0c94f8ae2fa3..59431620f203 100644
--- a/platform/linux-generic/odp_ticketlock.c
+++ b/platform/linux-generic/odp_ticketlock.c
@@ -6,8 +6,9 @@ 
 
 #include "config.h"
 
+#include <odp/api/ticketlock.h>
+
 #include <odp/api/plat/ticketlock_inlines.h>
-#include <odp/api/spec/ticketlock.h>
 
 void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
 {
@@ -16,6 +17,7 @@  void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
 }
 
 /* Include non-inlined versions of API functions */
+#include <odp/api/plat/static_inline.h>
 #if ODP_ABI_COMPAT == 1
 #include <odp/api/plat/ticketlock_inlines_api.h>
 #endif