aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-08-09 09:54:32 +0300
committerMatias Elo <matias.elo@nokia.com>2023-08-17 13:22:51 +0300
commit72e001d3dee103dc8ba780bb819a18ba22503dd4 (patch)
treef53c3536db036a0fe045f32df74d63df44a642b3
parentaf8f6a307c781f98ea58b6a7b1ac47b74ae58d54 (diff)
Port 009ee2e68 "linux-gen: timer: implement odp_timeout_from_event_multi() function"
Port original commit from linux-generic. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/timer_inlines.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h b/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h
index 357d4df06..66327acdb 100644
--- a/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2022, Nokia
+/* Copyright (c) 2022-2023, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -25,6 +25,7 @@
#define odp_timeout_user_ptr __odp_timeout_user_ptr
#define odp_timeout_user_area __odp_timeout_user_area
#define odp_timeout_from_event __odp_timeout_from_event
+ #define odp_timeout_from_event_multi __odp_timeout_from_event_multi
#define odp_timeout_to_event __odp_timeout_to_event
#else
#define _ODP_INLINE
@@ -57,6 +58,15 @@ _ODP_INLINE odp_timeout_t odp_timeout_from_event(odp_event_t ev)
return (odp_timeout_t)ev;
}
+_ODP_INLINE void odp_timeout_from_event_multi(odp_timeout_t tmo[], const odp_event_t ev[], int num)
+{
+ for (int i = 0; i < num; i++) {
+ _ODP_ASSERT(odp_event_type(ev[i]) == ODP_EVENT_TIMEOUT);
+
+ tmo[i] = (odp_timeout_t)ev[i];
+ }
+}
+
_ODP_INLINE odp_event_t odp_timeout_to_event(odp_timeout_t tmo)
{
return (odp_event_t)tmo;