diff mbox series

[v4,6/8] abi: pool: added initial definitions

Message ID 1485850046-28457-7-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit 1c0488456166888148bf191960691d076f5a9c2e
Headers show
Series First ABI files | expand

Commit Message

Petri Savolainen Jan. 31, 2017, 8:07 a.m. UTC
Initially, use the same default ABI file for all architectures.
Default values match those defined in odp-linux implementation
to minimize changes in this phase.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
 example/timer/odp_timer_test.c                     |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/pool.h    |  7 ++++
 include/odp/arch/arm64-linux/odp/api/abi/pool.h    |  7 ++++
 include/odp/arch/default/api/abi/pool.h            | 43 ++++++++++++++++++++++
 include/odp/arch/mips64-linux/odp/api/abi/pool.h   |  7 ++++
 include/odp/arch/power64-linux/odp/api/abi/pool.h  |  7 ++++
 include/odp/arch/x86_32-linux/odp/api/abi/pool.h   |  7 ++++
 include/odp/arch/x86_64-linux/odp/api/abi/pool.h   |  7 ++++
 platform/Makefile.inc                              |  6 ++-
 .../include/odp/api/plat/pool_types.h              | 21 ++++++-----
 10 files changed, 102 insertions(+), 12 deletions(-)
 create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/pool.h
 create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/pool.h
 create mode 100644 include/odp/arch/default/api/abi/pool.h
 create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/pool.h
 create mode 100644 include/odp/arch/power64-linux/odp/api/abi/pool.h
 create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/pool.h
 create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/pool.h

-- 
2.8.1
diff mbox series

Patch

diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 1088a74..2196b8c 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -520,7 +520,7 @@  err:
 	if (gbls != NULL && gbls->tp != ODP_TIMER_POOL_INVALID)
 		odp_timer_pool_destroy(gbls->tp);
 
-	if (gbls != NULL && gbls->pool != ODP_TIMER_POOL_INVALID)
+	if (gbls != NULL && gbls->pool != ODP_POOL_INVALID)
 		if (odp_pool_destroy(gbls->pool))
 			err = 1;
 
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/pool.h b/include/odp/arch/arm32-linux/odp/api/abi/pool.h
new file mode 100644
index 0000000..b354afb
--- /dev/null
+++ b/include/odp/arch/arm32-linux/odp/api/abi/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/pool.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/pool.h b/include/odp/arch/arm64-linux/odp/api/abi/pool.h
new file mode 100644
index 0000000..b354afb
--- /dev/null
+++ b/include/odp/arch/arm64-linux/odp/api/abi/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/pool.h>
diff --git a/include/odp/arch/default/api/abi/pool.h b/include/odp/arch/default/api/abi/pool.h
new file mode 100644
index 0000000..4637d19
--- /dev/null
+++ b/include/odp/arch/default/api/abi/pool.h
@@ -0,0 +1,43 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_ABI_POOL_H_
+#define ODP_ABI_POOL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/abi/event.h>
+
+/** @internal Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_pool_t;
+
+/** @ingroup odp_pool
+ *  @{
+ */
+
+typedef _odp_abi_pool_t *odp_pool_t;
+
+#define ODP_POOL_INVALID   ((odp_pool_t)0xffffffff)
+
+#define ODP_POOL_NAME_LEN  32
+
+typedef enum odp_pool_type_t {
+	ODP_POOL_BUFFER  = ODP_EVENT_BUFFER,
+	ODP_POOL_PACKET  = ODP_EVENT_PACKET,
+	ODP_POOL_TIMEOUT = ODP_EVENT_TIMEOUT
+} odp_pool_type_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/odp/arch/mips64-linux/odp/api/abi/pool.h b/include/odp/arch/mips64-linux/odp/api/abi/pool.h
new file mode 100644
index 0000000..b354afb
--- /dev/null
+++ b/include/odp/arch/mips64-linux/odp/api/abi/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/pool.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/pool.h b/include/odp/arch/power64-linux/odp/api/abi/pool.h
new file mode 100644
index 0000000..b354afb
--- /dev/null
+++ b/include/odp/arch/power64-linux/odp/api/abi/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/pool.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/pool.h b/include/odp/arch/x86_32-linux/odp/api/abi/pool.h
new file mode 100644
index 0000000..b354afb
--- /dev/null
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/pool.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/pool.h b/include/odp/arch/x86_64-linux/odp/api/abi/pool.h
new file mode 100644
index 0000000..b354afb
--- /dev/null
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/pool.h
@@ -0,0 +1,7 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/pool.h>
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 03d9376..deeebff 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -66,7 +66,8 @@  odpapiabidefaultinclude_HEADERS = \
 	$(top_srcdir)/include/odp/arch/default/api/abi/classification.h \
 	$(top_srcdir)/include/odp/arch/default/api/abi/crypto.h \
 	$(top_srcdir)/include/odp/arch/default/api/abi/event.h \
-	$(top_srcdir)/include/odp/arch/default/api/abi/packet.h
+	$(top_srcdir)/include/odp/arch/default/api/abi/packet.h \
+	$(top_srcdir)/include/odp/arch/default/api/abi/pool.h
 
 odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
@@ -74,7 +75,8 @@  odpapiabiarchinclude_HEADERS = \
 	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/classification.h \
 	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/crypto.h \
 	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/event.h \
-	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/packet.h
+	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/packet.h \
+	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/pool.h
 
 EXTRA_DIST = \
 	     arch/arm/odp/api/cpu_arch.h \
diff --git a/platform/linux-generic/include/odp/api/plat/pool_types.h b/platform/linux-generic/include/odp/api/plat/pool_types.h
index 6baff09..8bc816d 100644
--- a/platform/linux-generic/include/odp/api/plat/pool_types.h
+++ b/platform/linux-generic/include/odp/api/plat/pool_types.h
@@ -13,16 +13,20 @@ 
 #ifndef ODP_POOL_TYPES_H_
 #define ODP_POOL_TYPES_H_
 
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-#include <odp/api/plat/event_types.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/** @addtogroup odp_buffer
- *  Operations on a pool.
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 1
+#include <odp/api/abi/pool.h>
+#else
+
+#include <odp/api/std_types.h>
+#include <odp/api/plat/strong_types.h>
+#include <odp/api/plat/event_types.h>
+
+/** @ingroup odp_pool
  *  @{
  */
 
@@ -32,9 +36,6 @@  typedef ODP_HANDLE_T(odp_pool_t);
 
 #define ODP_POOL_NAME_LEN  32
 
-/**
- * Pool type
- */
 typedef enum odp_pool_type_t {
 	ODP_POOL_BUFFER  = ODP_EVENT_BUFFER,
 	ODP_POOL_PACKET  = ODP_EVENT_PACKET,
@@ -45,6 +46,8 @@  typedef enum odp_pool_type_t {
  * @}
  */
 
+#endif
+
 #ifdef __cplusplus
 }
 #endif