@@ -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 \
similarity index 54%
rename from platform/linux-generic/include/odp/api/ticketlock.h
rename to 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>
@@ -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 \
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
@@ -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
}
@@ -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
@@ -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>
@@ -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
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