diff mbox

[PATCHv5,14/19] linux-generic: events: add strong typing support

Message ID 1422938699-12877-15-git-send-email-bill.fischofer@linaro.org
State New
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/event_types.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp/plat/event_types.h b/platform/linux-generic/include/odp/plat/event_types.h
index 4a0756b..8db4b80 100644
--- a/platform/linux-generic/include/odp/plat/event_types.h
+++ b/platform/linux-generic/include/odp/plat/event_types.h
@@ -18,17 +18,17 @@ 
 extern "C" {
 #endif
 
-
-#include <odp/plat/buffer_types.h>
+#include <odp/std_types.h>
+#include <odp/plat/strong_types.h>
 
 /** @defgroup odp_event ODP EVENT
  *  Operations on an event.
  *  @{
  */
 
-typedef odp_buffer_t odp_event_t;
+typedef odp_handle_t odp_event_t;
 
-#define ODP_EVENT_INVALID ODP_BUFFER_INVALID
+#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff)
 
 #define ODP_EVENT_TYPE_INVALID (-1)
 #define ODP_EVENT_BUFFER         1
@@ -36,6 +36,12 @@  typedef odp_buffer_t odp_event_t;
 #define ODP_EVENT_TIMEOUT        3
 #define ODP_EVENT_CRYPTO_COMPL   4
 
+/** Get printable format of odp_event_t */
+static inline uint64_t odp_event_to_u64(odp_event_t hdl)
+{
+	return _odp_pri(hdl);
+}
+
 /**
  * @}
  */