diff mbox

[PATCHv5,13/19] linux-generic: crypto: add strong typing support

Message ID 1422938699-12877-14-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit be89e8ba552fb6200e8a770433aa3e3741fdc46c
Headers show

Commit Message

Bill Fischofer Feb. 3, 2015, 4:44 a.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/include/odp/plat/crypto_types.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp/plat/crypto_types.h b/platform/linux-generic/include/odp/plat/crypto_types.h
index d0c61b0..3c26aa1 100644
--- a/platform/linux-generic/include/odp/plat/crypto_types.h
+++ b/platform/linux-generic/include/odp/plat/crypto_types.h
@@ -25,7 +25,7 @@  extern "C" {
 #define ODP_CRYPTO_SESSION_INVALID (0xffffffffffffffffULL)
 
 typedef uint64_t odp_crypto_session_t;
-typedef odp_packet_t odp_crypto_compl_t;
+typedef odp_handle_t odp_crypto_compl_t;
 
 enum odp_crypto_op_mode {
 	ODP_CRYPTO_SYNC,
@@ -68,6 +68,17 @@  enum crypto_hw_err {
 	ODP_CRYPTO_HW_ERR_BP_DEPLETED,
 };
 
+/** 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);
+}
 
 /**
  * @}