[API-NEXT,v6,1/2] api: schedule: add schedule order unlock lock api

Message ID 1505228428-32327-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [API-NEXT,v6,1/2] api: schedule: add schedule order unlock lock api
Related show

Commit Message

Github ODP bot Sept. 12, 2017, 3 p.m.
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


Adds odp_schedule_order_unlock_lock() api. This API combines schedule order
unlock and lock into a single api for performance optimization in HW.

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 160 (bala-manoharan:api_sched_order_lock)
 ** https://github.com/Linaro/odp/pull/160
 ** Patch: https://github.com/Linaro/odp/pull/160.patch
 ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1
 ** Merge commit sha: 14974ba25c29ba2d92eed93e083a4ce292b7602b
 **/
 include/odp/api/spec/schedule.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Patch

diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 8244746d..1c7ef38a 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -347,6 +347,9 @@  int odp_schedule_group_info(odp_schedule_group_t group,
  * be protected by its own ordered lock. This promotes maximum parallelism by
  * allowing order to maintained on a more granular basis. If an ordered lock
  * is used multiple times in the same ordered context results are undefined.
+ * Only one ordered lock can be active in an ordered context at any given time.
+ * Resuls are undefined when multiple ordered locks are acquired in nested
+ * fashion within the same ordered context.
  *
  * @param lock_index Index of the ordered lock in the current context to be
  *                   acquired. Must be in the range 0..odp_queue_lock_count()
@@ -368,6 +371,31 @@  void odp_schedule_order_lock(unsigned lock_index);
 void odp_schedule_order_unlock(unsigned lock_index);
 
 /**
+ * Release existing ordered context lock and acquire a new lock
+ *
+ * This call is valid only when holding an ordered synchronization context.
+ * Release a previously locked ordered context lock and acquire a new ordered
+ * context lock. This call is valid only when there is a single ordered context
+ * lock active. Results are undefined if this call is made when multiple ordered
+ * context locks are acquired in nested fashion.
+ * This call does not release the existing ordered context and only switches
+ * from one ordered lock to another ordered lock within the same ordered
+ * context.
+ *
+ * @param unlock_index	Index of the acquired ordered lock in the current
+ *			context to be released. Results are undefined if the
+ *			ordered lock with the given unlock_index is not held by
+ *			this ordered context.
+ * @param lock_index	Index of the ordered lock in the current context to be
+ *			acquired. Previously acquired ordered lock is released.
+ *			Must be in the range 0...odp_queue_lock_count() - 1.
+ *
+ * @see odp_schedule_order_lock(), odp_schedule_order_unlock()
+ *
+ */
+void odp_schedule_order_unlock_lock(uint32_t unlock_index, uint32_t lock_index);
+
+/**
  * @}
  */