diff mbox

[PATCHv2,1/8] api: event: Add event type

Message ID 1421816266-31223-2-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Jan. 21, 2015, 4:57 a.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/Makefile.am                 |  1 +
 platform/linux-generic/include/api/odp_event.h     | 59 ++++++++++++++++++++++
 .../linux-generic/include/api/odp_platform_types.h |  6 +++
 3 files changed, 66 insertions(+)
 create mode 100644 platform/linux-generic/include/api/odp_event.h
diff mbox

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index a699ea6..00bb0f9 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -19,6 +19,7 @@  include_HEADERS = \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_cpumask.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_crypto.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_debug.h \
+		  $(top_srcdir)/platform/linux-generic/include/api/odp_event.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_hints.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_init.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_packet_flags.h \
diff --git a/platform/linux-generic/include/api/odp_event.h b/platform/linux-generic/include/api/odp_event.h
new file mode 100644
index 0000000..48e5c22
--- /dev/null
+++ b/platform/linux-generic/include/api/odp_event.h
@@ -0,0 +1,59 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP event
+ */
+
+#ifndef ODP_EVENT_H_
+#define ODP_EVENT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <odp_std_types.h>
+#include <odp_platform_types.h>
+
+/** @defgroup odp_event ODP EVENT
+ *  Operations on an event.
+ *  @{
+ */
+
+
+/**
+ * Event type
+ *
+ * @param event    Event handle
+ *
+ * @return Event type or ODP_EVENT_TYPE_INVALID
+ */
+int odp_event_type(odp_event_t event);
+
+/**< Invalid event type */
+#define ODP_EVENT_TYPE_INVALID (-1)
+/**< Packet event */
+#define ODP_EVENT_PACKET       (ODP_EVENT_TYPE_INVALID + 1)
+/**< Buffer event */
+#define ODP_EVENT_BUFFER       (ODP_EVENT_TYPE_INVALID + 2)
+/**< Timeout event */
+#define ODP_EVENT_TIMEOUT      (ODP_EVENT_TYPE_INVALID + 3)
+
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/include/api/odp_platform_types.h b/platform/linux-generic/include/api/odp_platform_types.h
index 6ed9e78..41ea871 100644
--- a/platform/linux-generic/include/api/odp_platform_types.h
+++ b/platform/linux-generic/include/api/odp_platform_types.h
@@ -65,6 +65,12 @@  typedef uint32_t odp_pktio_t;
 /** odp_pktio_t value to indicate any port */
 #define ODP_PKTIO_ANY ((odp_pktio_t)~0)
 
+/** ODP event */
+typedef uint32_t odp_event_t;
+
+/** Invalid event */
+#define ODP_EVENT_INVALID ODP_BUFFER_INVALID
+
 /**
  * ODP shared memory block
  */