@@ -98,6 +98,7 @@ odpapiplatinclude_HEADERS = \
$(srcdir)/include/odp/api/plat/thread_types.h \
$(srcdir)/include/odp/api/plat/thrmask_types.h \
$(srcdir)/include/odp/api/plat/ticketlock_inlines.h \
+ $(srcdir)/include/odp/api/plat/ticketlock_inlines_api.h \
$(srcdir)/include/odp/api/plat/ticketlock_types.h \
$(srcdir)/include/odp/api/plat/time_types.h \
$(srcdir)/include/odp/api/plat/timer_types.h \
@@ -13,11 +13,12 @@
#ifndef _ODP_PLAT_TICKETLOCK_INLINES_H_
#define _ODP_PLAT_TICKETLOCK_INLINES_H_
-#include <odp/api/ticketlock.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.
*
@@ -110,4 +111,20 @@ 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
new file mode 100644
@@ -0,0 +1,36 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * Ticketlock inline functions
+ */
+
+#ifndef _ODP_PLAT_TICKETLOCK_INLINES_API_H_
+#define _ODP_PLAT_TICKETLOCK_INLINES_API_H_
+
+_ODP_INLINE void odp_ticketlock_lock(odp_ticketlock_t *lock)
+{
+ return _odp_ticketlock_lock(lock);
+}
+
+_ODP_INLINE int odp_ticketlock_trylock(odp_ticketlock_t *lock)
+{
+ return _odp_ticketlock_trylock(lock);
+}
+
+_ODP_INLINE void odp_ticketlock_unlock(odp_ticketlock_t *lock)
+{
+ _odp_ticketlock_unlock(lock);
+}
+
+_ODP_INLINE int odp_ticketlock_is_locked(odp_ticketlock_t *lock)
+{
+ return _odp_ticketlock_is_locked(lock);
+}
+
+#endif
@@ -19,6 +19,10 @@ extern "C" {
#include <odp/api/plat/ticketlock_types.h>
+#if ODP_ABI_COMPAT == 0
+#include <odp/api/plat/ticketlock_inlines.h>
+#endif
+
#include <odp/api/spec/ticketlock.h>
#ifdef __cplusplus
@@ -5,6 +5,7 @@
*/
#include <odp/api/plat/ticketlock_inlines.h>
+#include <odp/api/spec/ticketlock.h>
void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
{
@@ -12,22 +13,7 @@ void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
odp_atomic_init_u32(&ticketlock->cur_ticket, 0);
}
-void odp_ticketlock_lock(odp_ticketlock_t *lock)
-{
- return _odp_ticketlock_lock(lock);
-}
-
-int odp_ticketlock_trylock(odp_ticketlock_t *lock)
-{
- return _odp_ticketlock_trylock(lock);
-}
-
-void odp_ticketlock_unlock(odp_ticketlock_t *lock)
-{
- _odp_ticketlock_unlock(lock);
-}
-
-int odp_ticketlock_is_locked(odp_ticketlock_t *lock)
-{
- return _odp_ticketlock_is_locked(lock);
-}
+/* Include non-inlined versions of API functions */
+#if ODP_ABI_COMPAT == 1
+#include <odp/api/plat/ticketlock_inlines_api.h>
+#endif