diff mbox series

[API-NEXT,v1,7/12] api: event: event type multi

Message ID 1512140407-13534-8-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/12] api: event: add free multiple | expand

Commit Message

Github ODP bot Dec. 1, 2017, 3 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


This functions allows application to check event type of
multiple events with single call e.g. after receiving those
from odp_schedule_multi(). Performance is optimized when
application can pass a burst of packets (or other events)
from one API call to another.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 318 (psavol:next-multi-apis)
 ** https://github.com/Linaro/odp/pull/318
 ** Patch: https://github.com/Linaro/odp/pull/318.patch
 ** Base sha: bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0
 ** Merge commit sha: aee2bcc574d2a8efdfcecc3b8e681ce391119798
 **/
 include/odp/api/spec/event.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index 7e895c315..e5edaacc9 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -125,6 +125,22 @@  odp_event_subtype_t odp_event_subtype(odp_event_t event);
 odp_event_type_t odp_event_types(odp_event_t event,
 				 odp_event_subtype_t *subtype);
 
+/**
+ * Event type of multiple events
+ *
+ * Returns the number of first events in the array which have the same event
+ * type. Outputs the event type of those events.
+ *
+ * @param      event    Array of event handles
+ * @param      num      Number of events (> 0)
+ * @param[out] type     Event type pointer for output
+ *
+ * @return Number of first events (1 ... num) with the same event type
+ *         (includes event[0])
+ */
+int odp_event_type_multi(const odp_event_t event[], int num,
+			 odp_event_type_t *type);
+
 /**
  * Get printable value for an odp_event_t
  *