diff mbox series

[v4,4/8] abi: crypto: added initial definitions

Message ID 1485850046-28457-5-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit 0a62e1c5b92a5170aa807cc8803f42698b23f4c8
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/crypto.h  |  7 +++++
 include/odp/arch/arm64-linux/odp/api/abi/crypto.h  |  7 +++++
 include/odp/arch/default/api/abi/crypto.h          | 36 ++++++++++++++++++++++
 include/odp/arch/mips64-linux/odp/api/abi/crypto.h |  7 +++++
 .../odp/arch/power64-linux/odp/api/abi/crypto.h    |  7 +++++
 include/odp/arch/x86_32-linux/odp/api/abi/crypto.h |  7 +++++
 include/odp/arch/x86_64-linux/odp/api/abi/crypto.h |  7 +++++
 platform/Makefile.inc                              |  2 ++
 .../include/odp/api/plat/crypto_types.h            | 21 +++++--------
 platform/linux-generic/odp_crypto.c                | 10 ++++++
 10 files changed, 98 insertions(+), 13 deletions(-)
 create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/crypto.h
 create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/crypto.h
 create mode 100644 include/odp/arch/default/api/abi/crypto.h
 create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/crypto.h
 create mode 100644 include/odp/arch/power64-linux/odp/api/abi/crypto.h
 create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/crypto.h
 create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/crypto.h

-- 
2.8.1
diff mbox series

Patch

diff --git a/include/odp/arch/arm32-linux/odp/api/abi/crypto.h b/include/odp/arch/arm32-linux/odp/api/abi/crypto.h
new file mode 100644
index 0000000..9a9d2dc
--- /dev/null
+++ b/include/odp/arch/arm32-linux/odp/api/abi/crypto.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/crypto.h>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/crypto.h b/include/odp/arch/arm64-linux/odp/api/abi/crypto.h
new file mode 100644
index 0000000..9a9d2dc
--- /dev/null
+++ b/include/odp/arch/arm64-linux/odp/api/abi/crypto.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/crypto.h>
diff --git a/include/odp/arch/default/api/abi/crypto.h b/include/odp/arch/default/api/abi/crypto.h
new file mode 100644
index 0000000..f0793a1
--- /dev/null
+++ b/include/odp/arch/default/api/abi/crypto.h
@@ -0,0 +1,36 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_ABI_CRYPTO_H_
+#define ODP_ABI_CRYPTO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+/** @internal Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_crypto_compl_t;
+
+/** @ingroup odp_crypto
+ *  @{
+ */
+
+#define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL)
+
+typedef uint64_t  odp_crypto_session_t;
+typedef _odp_abi_crypto_compl_t *odp_crypto_compl_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/odp/arch/mips64-linux/odp/api/abi/crypto.h b/include/odp/arch/mips64-linux/odp/api/abi/crypto.h
new file mode 100644
index 0000000..9a9d2dc
--- /dev/null
+++ b/include/odp/arch/mips64-linux/odp/api/abi/crypto.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/crypto.h>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/crypto.h b/include/odp/arch/power64-linux/odp/api/abi/crypto.h
new file mode 100644
index 0000000..9a9d2dc
--- /dev/null
+++ b/include/odp/arch/power64-linux/odp/api/abi/crypto.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/crypto.h>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h b/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h
new file mode 100644
index 0000000..9a9d2dc
--- /dev/null
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/crypto.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/crypto.h>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h b/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h
new file mode 100644
index 0000000..9a9d2dc
--- /dev/null
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/crypto.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/crypto.h>
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index bb40692..29ed347 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -64,12 +64,14 @@  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/classification.h \
+	$(top_srcdir)/include/odp/arch/default/api/abi/crypto.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/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
 
 EXTRA_DIST = \
diff --git a/platform/linux-generic/include/odp/api/plat/crypto_types.h b/platform/linux-generic/include/odp/api/plat/crypto_types.h
index 0cbbce8..2cc747e 100644
--- a/platform/linux-generic/include/odp/api/plat/crypto_types.h
+++ b/platform/linux-generic/include/odp/api/plat/crypto_types.h
@@ -18,7 +18,12 @@ 
 extern "C" {
 #endif
 
-/** @addtogroup odp_crypto
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 1
+#include <odp/api/abi/crypto.h>
+#else
+
+/** @ingroup odp_crypto
  *  @{
  */
 
@@ -27,22 +32,12 @@  extern "C" {
 typedef uint64_t odp_crypto_session_t;
 typedef ODP_HANDLE_T(odp_crypto_compl_t);
 
-/** Get printable format of odp_crypto_session_t */
-static inline uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl)
-{
-	return (uint64_t)hdl;
-}
-
-/** Get printable format of odp_crypto_compl_t_t */
-static inline uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
-{
-	return _odp_pri(hdl);
-}
-
 /**
  * @}
  */
 
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index 4f17fd6..b53b0fc 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -1120,3 +1120,13 @@  void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
 {
 	memset(param, 0, sizeof(odp_crypto_session_param_t));
 }
+
+uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl)
+{
+	return (uint64_t)hdl;
+}
+
+uint64_t odp_crypto_compl_to_u64(odp_crypto_compl_t hdl)
+{
+	return _odp_pri(hdl);
+}