aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic')
-rw-r--r--platform/linux-generic/include/odp/api/plat/buffer_inlines.h10
-rw-r--r--platform/linux-generic/include/odp/api/plat/event_inline_types.h1
-rw-r--r--platform/linux-generic/odp_event.c3
-rw-r--r--platform/linux-generic/odp_pool.c14
4 files changed, 12 insertions, 16 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 3da402a83..9466ff73d 100644
--- a/platform/linux-generic/include/odp/api/plat/buffer_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/buffer_inlines.h
@@ -7,8 +7,10 @@
#ifndef ODP_PLAT_BUFFER_INLINES_H_
#define ODP_PLAT_BUFFER_INLINES_H_
+#include <odp/api/event_types.h>
+#include <odp/api/pool_types.h>
+
#include <odp/api/abi/buffer.h>
-#include <odp/api/abi/event_types.h>
#include <odp/api/plat/event_inline_types.h>
@@ -22,6 +24,7 @@ extern const _odp_event_inline_offset_t _odp_event_inline_offset;
#define odp_buffer_from_event __odp_buffer_from_event
#define odp_buffer_to_event __odp_buffer_to_event
#define odp_buffer_addr __odp_buffer_addr
+ #define odp_buffer_pool __odp_buffer_pool
#else
#define _ODP_INLINE
#endif
@@ -41,6 +44,11 @@ _ODP_INLINE void *odp_buffer_addr(odp_buffer_t buf)
return _odp_event_hdr_field((odp_event_t)buf, void *, base_data);
}
+_ODP_INLINE odp_pool_t odp_buffer_pool(odp_buffer_t buf)
+{
+ return (odp_pool_t)(uintptr_t)_odp_event_hdr_field(buf, void *, pool);
+}
+
/** @endcond */
#endif
diff --git a/platform/linux-generic/include/odp/api/plat/event_inline_types.h b/platform/linux-generic/include/odp/api/plat/event_inline_types.h
index c2727ec6f..77a0deecb 100644
--- a/platform/linux-generic/include/odp/api/plat/event_inline_types.h
+++ b/platform/linux-generic/include/odp/api/plat/event_inline_types.h
@@ -29,6 +29,7 @@ typedef struct _odp_event_inline_offset_t {
uint16_t event_type;
uint16_t base_data;
uint16_t flow_id;
+ uint16_t pool;
} _odp_event_inline_offset_t;
diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c
index 50cb03a19..a528b5d81 100644
--- a/platform/linux-generic/odp_event.c
+++ b/platform/linux-generic/odp_event.c
@@ -35,7 +35,8 @@ const _odp_event_inline_offset_t
_odp_event_inline_offset ODP_ALIGNED_CACHE = {
.event_type = offsetof(_odp_event_hdr_t, event_type),
.base_data = offsetof(_odp_event_hdr_t, base_data),
- .flow_id = offsetof(_odp_event_hdr_t, flow_id)
+ .flow_id = offsetof(_odp_event_hdr_t, flow_id),
+ .pool = offsetof(_odp_event_hdr_t, pool_ptr),
};
#include <odp/visibility_end.h>
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index 196a118de..f76cb1e47 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -78,13 +78,6 @@ const _odp_pool_inline_offset_t _odp_pool_inline ODP_ALIGNED_CACHE = {
#include <odp/visibility_end.h>
-static inline pool_t *pool_from_buf(odp_buffer_t buf)
-{
- odp_buffer_hdr_t *buf_hdr = _odp_buf_hdr(buf);
-
- return buf_hdr->event_hdr.pool_ptr;
-}
-
static inline void cache_init(pool_cache_t *cache)
{
memset(cache, 0, sizeof(pool_cache_t));
@@ -1526,13 +1519,6 @@ void odp_pool_print_all(void)
ODP_PRINT("\n");
}
-odp_pool_t odp_buffer_pool(odp_buffer_t buf)
-{
- pool_t *pool = pool_from_buf(buf);
-
- return _odp_pool_handle(pool);
-}
-
void odp_pool_param_init(odp_pool_param_t *params)
{
uint32_t default_cache_size = _odp_pool_glb->config.local_cache_size;