diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-10-21 17:34:19 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-11-30 09:19:08 +0200 |
commit | 19bcb9061ad1205eb63fd216411b8d8aac29dd77 (patch) | |
tree | fdd6f8651dc54b9b5f74375d7503ed319ad0377d /platform/linux-generic/include/odp/api/plat | |
parent | 4b6f7c07fad4f3f195eddeceb82c77565a8d7914 (diff) |
linux-gen: buffer: implement multi variants of event conversion functions
Implement new odp_buffer_from_event_multi() and odp_buffer_to_event_multi()
functions.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'platform/linux-generic/include/odp/api/plat')
-rw-r--r-- | platform/linux-generic/include/odp/api/plat/buffer_inlines.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp/api/plat/buffer_inlines.h b/platform/linux-generic/include/odp/api/plat/buffer_inlines.h index f3e133910..34d4b5675 100644 --- a/platform/linux-generic/include/odp/api/plat/buffer_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/buffer_inlines.h @@ -23,7 +23,9 @@ /* Inline functions by default */ #define _ODP_INLINE static inline #define odp_buffer_from_event __odp_buffer_from_event + #define odp_buffer_from_event_multi __odp_buffer_from_event_multi #define odp_buffer_to_event __odp_buffer_to_event + #define odp_buffer_to_event_multi __odp_buffer_to_event_multi #define odp_buffer_addr __odp_buffer_addr #define odp_buffer_size __odp_buffer_size #define odp_buffer_pool __odp_buffer_pool @@ -39,11 +41,23 @@ _ODP_INLINE odp_buffer_t odp_buffer_from_event(odp_event_t ev) return (odp_buffer_t)ev; } +_ODP_INLINE void odp_buffer_from_event_multi(odp_buffer_t buf[], const odp_event_t ev[], int num) +{ + for (int i = 0; i < num; i++) + buf[i] = odp_buffer_from_event(ev[i]); +} + _ODP_INLINE odp_event_t odp_buffer_to_event(odp_buffer_t buf) { return (odp_event_t)buf; } +_ODP_INLINE void odp_buffer_to_event_multi(const odp_buffer_t buf[], odp_event_t ev[], int num) +{ + for (int i = 0; i < num; i++) + ev[i] = odp_buffer_to_event(buf[i]); +} + _ODP_INLINE void *odp_buffer_addr(odp_buffer_t buf) { return _odp_event_hdr_field((odp_event_t)buf, void *, base_data); |