aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Nyström <david.c.nystrom@gmail.com>2014-05-20 10:44:15 +0200
committerroot <maxim.uvarov@linaro.org>2014-05-21 14:58:05 +0400
commitd1b2f87af8a276b6af7208ae26cad6dfcd1bf70a (patch)
tree46624242b1a980bdda921de37c8d336176cbb1cf /include
parent8daef26cb0825fa65df2453908ff355fca56729a (diff)
added ability to assign queue contexts
Signed-off-by: David Nyström <david.nystrom@enea.com>
Diffstat (limited to 'include')
-rw-r--r--include/odp_queue.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/include/odp_queue.h b/include/odp_queue.h
index 71499d88..5e083f1a 100644
--- a/include/odp_queue.h
+++ b/include/odp_queue.h
@@ -90,14 +90,15 @@ typedef int odp_schedule_group_t;
/**
* ODP Queue parameters
*/
-typedef union odp_queue_param_t {
+typedef struct odp_queue_param_t {
/** Scheduler parameters */
struct {
odp_schedule_prio_t prio;
odp_schedule_sync_t sync;
odp_schedule_group_t group;
} sched;
-
+ /** Queue context */
+ void *context;
} odp_queue_param_t;
@@ -123,6 +124,30 @@ odp_queue_t odp_queue_create(const char *name, odp_queue_type_t type,
odp_queue_t odp_queue_lookup(const char *name);
/**
+ * Set queue context
+ *
+ * Its the responsability of the interface user to make sure
+ * queue context allocation is done in an area reachable for
+ * all EOs accessing the context
+ *
+ * @param queue Queue handle
+ * @param context Address to the queue context
+ *
+ * @return 0 if successful
+ */
+int odp_queue_set_context(odp_queue_t queue, void *context);
+
+/**
+ * Get queue context
+ *
+ * @param queue Queue handle
+ *
+ * @return If successful, a pointer to the queue context,
+ * NULL for failure.
+ */
+void *odp_queue_get_context(odp_queue_t queue);
+
+/**
* Queue enqueue
*
* @param queue Queue handle