@@ -980,3 +980,30 @@ int odp_schedule_release_ordered(odp_event_t ev)
UNLOCK(&origin_qe->s.lock);
return 0;
}
+
+int odp_schedule_order_copy(odp_event_t src_event, odp_event_t dst_event)
+{
+ odp_buffer_hdr_t *src =
+ odp_buf_to_hdr(odp_buffer_from_event(src_event));
+ odp_buffer_hdr_t *dst =
+ odp_buf_to_hdr(odp_buffer_from_event(dst_event));
+ queue_entry_t *origin_qe = src->origin_qe;
+
+ if (!origin_qe || dst->origin_qe)
+ return -1;
+
+ LOCK(&origin_qe->s.lock);
+
+ if (src->origin_qe != origin_qe) {
+ UNLOCK(&origin_qe->s.lock);
+ return -1;
+ }
+
+ dst->origin_qe = origin_qe;
+ dst->order = src->order;
+ dst->sync = src->sync;
+ src->flags.sustain = 1;
+
+ UNLOCK(&origin_qe->s.lock);
+ return 0;
+}
@@ -746,3 +746,27 @@ int odp_schedule_group_count(odp_schedule_group_t group)
void odp_schedule_prefetch(int num ODP_UNUSED)
{
}
+
+int odp_schedule_order_sustain(odp_event_t ev)
+{
+ odp_buffer_hdr_t *buf_hdr =
+ odp_buf_to_hdr(odp_buffer_from_event(ev));
+
+ if (buf_hdr->origin_qe)
+ return buf_hdr->flags.sustain;
+
+ return -1;
+}
+
+int odp_schedule_order_sustain_set(odp_event_t ev, odp_bool_t sustain)
+{
+ odp_buffer_hdr_t *buf_hdr =
+ odp_buf_to_hdr(odp_buffer_from_event(ev));
+
+ if (buf_hdr->origin_qe && (sustain & 1) == sustain) {
+ buf_hdr->flags.sustain = sustain;
+ return 0;
+ }
+
+ return -1;
+}
Implement the odp_schedule_order_copy(), odp_schedule_sustain(), and odp_schedule_sustain_set(), which together permit events to be inserted into an ordered flow. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/odp_queue.c | 27 +++++++++++++++++++++++++++ platform/linux-generic/odp_schedule.c | 24 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+)