diff mbox series

[v4,2/8] abi: buffer: added initial definitions

Message ID 1485850046-28457-3-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit 4afed247a6ee3058aa6dc3e66ed0bd5acff9ce97
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>

---
 include/odp/arch/arm32-linux/odp/api/abi/buffer.h  |  7 ++++
 include/odp/arch/arm64-linux/odp/api/abi/buffer.h  |  7 ++++
 include/odp/arch/default/api/abi/buffer.h          | 38 ++++++++++++++++++++++
 include/odp/arch/mips64-linux/odp/api/abi/buffer.h |  7 ++++
 .../odp/arch/power64-linux/odp/api/abi/buffer.h    |  7 ++++
 include/odp/arch/x86_32-linux/odp/api/abi/buffer.h |  7 ++++
 include/odp/arch/x86_64-linux/odp/api/abi/buffer.h |  7 ++++
 platform/Makefile.inc                              |  2 ++
 .../include/odp/api/plat/buffer_types.h            | 23 ++++++++-----
 platform/linux-generic/odp_buffer.c                |  5 +++
 10 files changed, 101 insertions(+), 9 deletions(-)
 create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/buffer.h
 create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/buffer.h
 create mode 100644 include/odp/arch/default/api/abi/buffer.h
 create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/buffer.h
 create mode 100644 include/odp/arch/power64-linux/odp/api/abi/buffer.h
 create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/buffer.h
 create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/buffer.h

-- 
2.8.1
diff mbox series

Patch

diff --git a/include/odp/arch/arm32-linux/odp/api/abi/buffer.h b/include/odp/arch/arm32-linux/odp/api/abi/buffer.h
new file mode 100644
index 0000000..d9c3193
--- /dev/null
+++ b/include/odp/arch/arm32-linux/odp/api/abi/buffer.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/buffer.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/buffer.h b/include/odp/arch/arm64-linux/odp/api/abi/buffer.h
new file mode 100644
index 0000000..d9c3193
--- /dev/null
+++ b/include/odp/arch/arm64-linux/odp/api/abi/buffer.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/buffer.h>
diff --git a/include/odp/arch/default/api/abi/buffer.h b/include/odp/arch/default/api/abi/buffer.h
new file mode 100644
index 0000000..eec6f01
--- /dev/null
+++ b/include/odp/arch/default/api/abi/buffer.h
@@ -0,0 +1,38 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_ABI_BUFFER_H_
+#define ODP_ABI_BUFFER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @internal Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_buffer_t;
+
+/** @internal Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_buffer_seg_t;
+
+/** @ingroup odp_buffer
+ *  @{
+ */
+
+typedef _odp_abi_buffer_t *odp_buffer_t;
+typedef _odp_abi_buffer_seg_t *odp_buffer_seg_t;
+
+#define ODP_BUFFER_INVALID   ((odp_buffer_t)0xffffffff)
+#define ODP_SEGMENT_INVALID  ((odp_buffer_seg_t)0xffffffff)
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/odp/arch/mips64-linux/odp/api/abi/buffer.h b/include/odp/arch/mips64-linux/odp/api/abi/buffer.h
new file mode 100644
index 0000000..d9c3193
--- /dev/null
+++ b/include/odp/arch/mips64-linux/odp/api/abi/buffer.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/buffer.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/buffer.h b/include/odp/arch/power64-linux/odp/api/abi/buffer.h
new file mode 100644
index 0000000..d9c3193
--- /dev/null
+++ b/include/odp/arch/power64-linux/odp/api/abi/buffer.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/buffer.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h b/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h
new file mode 100644
index 0000000..d9c3193
--- /dev/null
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/buffer.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/buffer.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h b/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h
new file mode 100644
index 0000000..d9c3193
--- /dev/null
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/buffer.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/buffer.h>
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index a24accb..b078df8 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -62,10 +62,12 @@  odpapispecinclude_HEADERS = \
 
 odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi
 odpapiabidefaultinclude_HEADERS = \
+	$(top_srcdir)/include/odp/arch/default/api/abi/buffer.h \
 	$(top_srcdir)/include/odp/arch/default/api/abi/event.h
 
 odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
+	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/buffer.h \
 	$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/event.h
 
 EXTRA_DIST = \
diff --git a/platform/linux-generic/include/odp/api/plat/buffer_types.h b/platform/linux-generic/include/odp/api/plat/buffer_types.h
index 344121b..809768f 100644
--- a/platform/linux-generic/include/odp/api/plat/buffer_types.h
+++ b/platform/linux-generic/include/odp/api/plat/buffer_types.h
@@ -17,26 +17,31 @@ 
 extern "C" {
 #endif
 
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 1
+#include <odp/api/abi/buffer.h>
+#else
+
 #include <odp/api/std_types.h>
 #include <odp/api/plat/strong_types.h>
 
-/** ODP buffer */
+/** @ingroup odp_buffer
+ *  @{
+ */
+
 typedef ODP_HANDLE_T(odp_buffer_t);
 
-/** Invalid buffer */
 #define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0xffffffff)
 
-/** ODP buffer segment */
 typedef ODP_HANDLE_T(odp_buffer_seg_t);
 
-/** Invalid segment */
 #define ODP_SEGMENT_INVALID ((odp_buffer_seg_t)ODP_BUFFER_INVALID)
 
-/** Get printable format of odp_buffer_t */
-static inline uint64_t odp_buffer_to_u64(odp_buffer_t hdl)
-{
-	return _odp_pri(hdl);
-}
+/**
+ * @}
+ */
+
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c
index b791039..88c8140 100644
--- a/platform/linux-generic/odp_buffer.c
+++ b/platform/linux-generic/odp_buffer.c
@@ -76,3 +76,8 @@  void odp_buffer_print(odp_buffer_t buf)
 
 	ODP_PRINT("\n%s\n", str);
 }
+
+uint64_t odp_buffer_to_u64(odp_buffer_t hdl)
+{
+	return _odp_pri(hdl);
+}