This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, cloud-dev has been updated via d3fe76f2af39af17a3661b866a442878abc31ddc (commit) via 083b31d9200f5cff4794511f2a9f865506c706ef (commit) from 0242ecfa64a663b7584054edcf02a8f9913391d6 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit d3fe76f2af39af17a3661b866a442878abc31ddc Author: Kevin Wang kevin.wang@arm.com Date: Mon Aug 21 14:11:17 2017 +0800
linux-gen: buffer: add generic implementation module
Signed-off-by: Kevin Wang kevin.wang@arm.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Yi He yi.he@linaro.org
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index e904046e..3e3e0c22 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -242,7 +242,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_atomic.c \ odp_barrier.c \ odp_bitmap.c \ - odp_buffer.c \ + buffer/generic.c \ buffer/subsystem.c \ odp_byteorder.c \ odp_classification.c \ @@ -331,6 +331,7 @@ __LIB__libodp_linux_la_SOURCES += pktio/pcap.c endif
pool/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE +buffer/generic.lo: AM_CFLAGS += -DIM_ACTIVE_MODULE
# Build modular framework into odp-linux library modularframeworkdir = $(top_srcdir)/frameworks/modular diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/buffer/generic.c similarity index 76% rename from platform/linux-generic/odp_buffer.c rename to platform/linux-generic/buffer/generic.c index b7ea88e6..c896e3d0 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/buffer/generic.c @@ -9,29 +9,30 @@ #include <odp_buffer_internal.h> #include <odp_buffer_inlines.h> #include <odp_debug_internal.h> +#include <odp_buffer_subsystem.h>
#include <string.h> #include <stdio.h> #include <inttypes.h>
-odp_buffer_t odp_buffer_from_event(odp_event_t ev) +static odp_buffer_t generic_buffer_from_event(odp_event_t ev) { return (odp_buffer_t)ev; }
-odp_event_t odp_buffer_to_event(odp_buffer_t buf) +static odp_event_t generic_buffer_to_event(odp_buffer_t buf) { return (odp_event_t)buf; }
-void *odp_buffer_addr(odp_buffer_t buf) +static void *generic_buffer_addr(odp_buffer_t buf) { odp_buffer_hdr_t *hdr = buf_hdl_to_hdr(buf);
return hdr->seg[0].data; }
-uint32_t odp_buffer_size(odp_buffer_t buf) +static uint32_t generic_buffer_size(odp_buffer_t buf) { odp_buffer_hdr_t *hdr = buf_hdl_to_hdr(buf);
@@ -52,34 +53,34 @@ int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf) hdr = buf_hdl_to_hdr(buf); pool = hdr->pool_ptr;
- len += snprintf(&str[len], n-len, + len += snprintf(&str[len], n - len, "Buffer\n"); - len += snprintf(&str[len], n-len, + len += snprintf(&str[len], n - len, " pool %" PRIu64 "\n", odp_pool_to_u64(pool->pool_hdl)); - len += snprintf(&str[len], n-len, + len += snprintf(&str[len], n - len, " addr %p\n", hdr->seg[0].data); - len += snprintf(&str[len], n-len, + len += snprintf(&str[len], n - len, " size %" PRIu32 "\n", hdr->size); - len += snprintf(&str[len], n-len, + len += snprintf(&str[len], n - len, " type %i\n", hdr->type);
return len; }
-void odp_buffer_print(odp_buffer_t buf) +static void generic_buffer_print(odp_buffer_t buf) { int max_len = 512; char str[max_len]; int len;
- len = odp_buffer_snprint(str, max_len-1, buf); + len = odp_buffer_snprint(str, max_len - 1, buf); str[len] = 0;
ODP_PRINT("\n%s\n", str); }
-uint64_t odp_buffer_to_u64(odp_buffer_t hdl) +static uint64_t generic_buffer_to_u64(odp_buffer_t hdl) { return _odp_pri(hdl); } @@ -265,7 +266,7 @@ void buffer_free_multi(odp_buffer_hdr_t *buf_hdr[], int num_total) } }
-odp_buffer_t odp_buffer_alloc(odp_pool_t pool_hdl) +static odp_buffer_t generic_buffer_alloc(odp_pool_t pool_hdl) { odp_buffer_t buf; pool_t *pool; @@ -282,7 +283,8 @@ odp_buffer_t odp_buffer_alloc(odp_pool_t pool_hdl) return ODP_BUFFER_INVALID; }
-int odp_buffer_alloc_multi(odp_pool_t pool_hdl, odp_buffer_t buf[], int num) +static int generic_buffer_alloc_multi(odp_pool_t pool_hdl, + odp_buffer_t buf[], int num) { pool_t *pool;
@@ -293,24 +295,24 @@ int odp_buffer_alloc_multi(odp_pool_t pool_hdl, odp_buffer_t buf[], int num) return buffer_alloc_multi(pool, (odp_buffer_hdr_t **)buf, num); }
-void odp_buffer_free(odp_buffer_t buf) +static void generic_buffer_free(odp_buffer_t buf) { buffer_free_multi((odp_buffer_hdr_t **)&buf, 1); }
-void odp_buffer_free_multi(const odp_buffer_t buf[], int num) +static void generic_buffer_free_multi(const odp_buffer_t buf[], int num) { buffer_free_multi((odp_buffer_hdr_t **)(uintptr_t)buf, num); }
-odp_pool_t odp_buffer_pool(odp_buffer_t buf) +static odp_pool_t generic_buffer_pool(odp_buffer_t buf) { pool_t *pool = pool_from_buf(buf);
return pool->pool_hdl; }
-int odp_buffer_is_valid(odp_buffer_t buf) +static int generic_buffer_is_valid(odp_buffer_t buf) { pool_t *pool;
@@ -327,3 +329,32 @@ int odp_buffer_is_valid(odp_buffer_t buf)
return 1; } + +odp_buffer_module_t generic_buffer = { + .base = { + .name = "generic_buffer", + .init_local = NULL, + .term_local = NULL, + .init_global = NULL, + .term_global = NULL, + }, + .buffer_from_event = generic_buffer_from_event, + .buffer_to_event = generic_buffer_to_event, + .buffer_addr = generic_buffer_addr, + .buffer_alloc_multi = generic_buffer_alloc_multi, + .buffer_free_multi = generic_buffer_free_multi, + .buffer_alloc = generic_buffer_alloc, + .buffer_free = generic_buffer_free, + .buffer_size = generic_buffer_size, + .buffer_is_valid = generic_buffer_is_valid, + .buffer_pool = generic_buffer_pool, + .buffer_print = generic_buffer_print, + .buffer_to_u64 = generic_buffer_to_u64, +}; + +ODP_MODULE_CONSTRUCTOR(generic_buffer) +{ + odp_module_constructor(&generic_buffer); + odp_subsystem_register_module(buffer, &generic_buffer); +} + diff --git a/platform/linux-generic/buffer/subsystem.c b/platform/linux-generic/buffer/subsystem.c index 96ddb012..d47525cf 100644 --- a/platform/linux-generic/buffer/subsystem.c +++ b/platform/linux-generic/buffer/subsystem.c @@ -5,13 +5,112 @@ * * SPDX-License-Identifier: BSD-3-Clause */ +#include <odp/api/buffer.h> +#include <odp_buffer_subsystem.h> +#include <odp_debug_internal.h> #include <odp_module.h>
-#define SUBSYSTEM_VERSION 0x00010000UL -ODP_SUBSYSTEM_DEFINE(buffer, "memory buffer public APIs", SUBSYSTEM_VERSION); +ODP_SUBSYSTEM_DEFINE(buffer, "memory buffer public APIs", + BUFFER_SUBSYSTEM_VERSION);
ODP_SUBSYSTEM_CONSTRUCTOR(buffer) { odp_subsystem_constructor(buffer); }
+odp_buffer_t odp_buffer_from_event(odp_event_t ev) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_from_event(ev); +} + +odp_event_t odp_buffer_to_event(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_to_event(buf); +} + +void *odp_buffer_addr(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_addr(buf); +} + +uint32_t odp_buffer_size(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_size(buf); +} + +void odp_buffer_print(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_print(buf); +} + +uint64_t odp_buffer_to_u64(odp_buffer_t hdl) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_to_u64(hdl); +} + +odp_buffer_t odp_buffer_alloc(odp_pool_t pool_hdl) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_alloc(pool_hdl); +} + +int odp_buffer_alloc_multi(odp_pool_t pool_hdl, odp_buffer_t buf[], int num) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_alloc_multi(pool_hdl, buf, num); +} + +void odp_buffer_free(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_free(buf); +} + +void odp_buffer_free_multi(const odp_buffer_t buf[], int num) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_free_multi(buf, num); +} + +odp_pool_t odp_buffer_pool(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_pool(buf); +} + +int odp_buffer_is_valid(odp_buffer_t buf) +{ + odp_buffer_module_t *mod; + + mod = odp_subsystem_active_module(buffer, mod); + return mod->buffer_is_valid(buf); +} + diff --git a/platform/linux-generic/include/odp_buffer_subsystem.h b/platform/linux-generic/include/odp_buffer_subsystem.h index 60f8b646..6b69c06f 100644 --- a/platform/linux-generic/include/odp_buffer_subsystem.h +++ b/platform/linux-generic/include/odp_buffer_subsystem.h @@ -16,6 +16,8 @@ extern "C" { #include <odp_module.h> #include <odp/api/buffer.h>
+#define BUFFER_SUBSYSTEM_VERSION 0x00010000UL + /* ODP buffer public APIs subsystem */ ODP_SUBSYSTEM_DECLARE(buffer);
commit 083b31d9200f5cff4794511f2a9f865506c706ef Author: Kevin Wang kevin.wang@arm.com Date: Mon Aug 14 11:16:40 2017 +0800
linux-gen: buffer: apply modular framework and create subsystem
Signed-off-by: Kevin Wang kevin.wang@arm.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Yi He yi.he@linaro.org
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 36d9290c..e904046e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -171,6 +171,7 @@ noinst_HEADERS = \ ${srcdir}/include/odp_bitmap_internal.h \ ${srcdir}/include/odp_bitset.h \ ${srcdir}/include/odp_buffer_internal.h \ + ${srcdir}/include/odp_buffer_subsystem.h \ ${srcdir}/include/odp_classification_datamodel.h \ ${srcdir}/include/odp_classification_inlines.h \ ${srcdir}/include/odp_classification_internal.h \ @@ -242,6 +243,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_barrier.c \ odp_bitmap.c \ odp_buffer.c \ + buffer/subsystem.c \ odp_byteorder.c \ odp_classification.c \ odp_cpu.c \ diff --git a/platform/linux-generic/buffer/subsystem.c b/platform/linux-generic/buffer/subsystem.c new file mode 100644 index 00000000..96ddb012 --- /dev/null +++ b/platform/linux-generic/buffer/subsystem.c @@ -0,0 +1,17 @@ +/* Copyright (c) 2017, ARM Limited. All rights reserved. + * + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +#include <odp_module.h> + +#define SUBSYSTEM_VERSION 0x00010000UL +ODP_SUBSYSTEM_DEFINE(buffer, "memory buffer public APIs", SUBSYSTEM_VERSION); + +ODP_SUBSYSTEM_CONSTRUCTOR(buffer) +{ + odp_subsystem_constructor(buffer); +} + diff --git a/platform/linux-generic/include/odp_buffer_subsystem.h b/platform/linux-generic/include/odp_buffer_subsystem.h new file mode 100644 index 00000000..60f8b646 --- /dev/null +++ b/platform/linux-generic/include/odp_buffer_subsystem.h @@ -0,0 +1,60 @@ +/* Copyright (c) 2017, ARM Limited. All rights reserved. + * + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_BUFFER_SUBSYSTEM_H_ +#define ODP_BUFFER_SUBSYSTEM_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp_module.h> +#include <odp/api/buffer.h> + +/* ODP buffer public APIs subsystem */ +ODP_SUBSYSTEM_DECLARE(buffer); + +/* Subsystem APIs declarations */ +ODP_SUBSYSTEM_API(buffer, odp_buffer_t, buffer_from_event, odp_event_t ev); +ODP_SUBSYSTEM_API(buffer, odp_event_t, buffer_to_event, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, void *, buffer_addr, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, uint32_t, buffer_size, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, int, buffer_is_valid, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, odp_pool_t, buffer_pool, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, odp_buffer_t, buffer_alloc, odp_pool_t pool_hdl); +ODP_SUBSYSTEM_API(buffer, int, buffer_alloc_multi, odp_pool_t pool_hdl, + odp_buffer_t buf[], int num); +ODP_SUBSYSTEM_API(buffer, void, buffer_free, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, void, buffer_free_multi, + const odp_buffer_t buf[], int num); +ODP_SUBSYSTEM_API(buffer, void, buffer_print, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, uint64_t, buffer_to_u64, odp_buffer_t hdl); + +typedef ODP_MODULE_CLASS(buffer) { + odp_module_base_t base; + + odp_api_proto(buffer, buffer_from_event) buffer_from_event; + odp_api_proto(buffer, buffer_to_event) buffer_to_event; + odp_api_proto(buffer, buffer_addr) buffer_addr; + odp_api_proto(buffer, buffer_alloc_multi) buffer_alloc_multi; + odp_api_proto(buffer, buffer_free_multi) buffer_free_multi; + odp_api_proto(buffer, buffer_alloc) buffer_alloc; + odp_api_proto(buffer, buffer_free) buffer_free; + odp_api_proto(buffer, buffer_size) buffer_size; + odp_api_proto(buffer, buffer_is_valid) buffer_is_valid; + odp_api_proto(buffer, buffer_pool) buffer_pool; + odp_api_proto(buffer, buffer_print) buffer_print; + odp_api_proto(buffer, buffer_to_u64) buffer_to_u64; +} odp_buffer_module_t; + +#ifdef __cplusplus +} +#endif + +#endif +
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/Makefile.am | 5 +- .../{odp_buffer.c => buffer/generic.c} | 67 ++++++++---- platform/linux-generic/buffer/subsystem.c | 116 +++++++++++++++++++++ .../linux-generic/include/odp_buffer_subsystem.h | 62 +++++++++++ 4 files changed, 231 insertions(+), 19 deletions(-) rename platform/linux-generic/{odp_buffer.c => buffer/generic.c} (76%) create mode 100644 platform/linux-generic/buffer/subsystem.c create mode 100644 platform/linux-generic/include/odp_buffer_subsystem.h
hooks/post-receive