From: Kevin Wang <kevin.w...@arm.com>

---
/** Email created from pull request 117 (kevinwangsk:cloud-dev)
 ** https://github.com/Linaro/odp/pull/117
 ** Patch: https://github.com/Linaro/odp/pull/117.patch
 ** Base sha: 370f93139e16633390cb28acda6296da8fee006d
 ** Merge commit sha: b2fdd36c723fee970da5c3bcd487cfd4b5eb18a9
 **/
 platform/linux-generic/Makefile.am                 |  2 +
 .../linux-generic/include/odp_pool_subsystem.h     | 50 ++++++++++++++++++++++
 platform/linux-generic/pool/subsystem.c            | 16 +++++++
 3 files changed, 68 insertions(+)
 create mode 100644 platform/linux-generic/include/odp_pool_subsystem.h
 create mode 100644 platform/linux-generic/pool/subsystem.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 4a7b77b8..dec8a0f4 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -183,6 +183,7 @@ noinst_HEADERS = \
                  ${srcdir}/include/odp_packet_tap.h \
                  ${srcdir}/include/odp_pkt_queue_internal.h \
                  ${srcdir}/include/odp_pool_internal.h \
+                 ${srcdir}/include/odp_pool_subsystem.h \
                  ${srcdir}/include/odp_posix_extensions.h \
                  ${srcdir}/include/odp_queue_internal.h \
                  ${srcdir}/include/odp_ring_internal.h \
@@ -239,6 +240,7 @@ __LIB__libodp_linux_la_SOURCES = \
                           pktio/sysfs.c \
                           pktio/tap.c \
                           pktio/ring.c \
+                          pool/subsystem.c \
                           odp_pkt_queue.c \
                           odp_pool.c \
                           odp_queue.c \
diff --git a/platform/linux-generic/include/odp_pool_subsystem.h 
b/platform/linux-generic/include/odp_pool_subsystem.h
new file mode 100644
index 00000000..45537a86
--- /dev/null
+++ b/platform/linux-generic/include/odp_pool_subsystem.h
@@ -0,0 +1,50 @@
+/* Copyright (c) 2017, ARM Limited. All rights reserved.
+ *
+ * Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_POOL_SUBSYSTEM_H_
+#define ODP_POOL_SUBSYSTEM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp_module.h>
+#include <odp/api/pool.h>
+
+/* ODP pool public APIs subsystem */
+ODP_SUBSYSTEM_DECLARE(pool);
+
+/* Subsystem APIs declarations */
+ODP_SUBSYSTEM_API(pool, int, capability, odp_pool_capability_t *capa);
+ODP_SUBSYSTEM_API(pool, odp_pool_t, create, const char *name,
+                 odp_pool_param_t *params);
+ODP_SUBSYSTEM_API(pool, int, destroy, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, odp_pool_t, lookup, const char *name);
+ODP_SUBSYSTEM_API(pool, int, info, odp_pool_t pool, odp_pool_info_t *info);
+ODP_SUBSYSTEM_API(pool, void, print, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, uint64_t, to_u64, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, void, param_init, odp_pool_param_t *params);
+
+typedef ODP_MODULE_CLASS(pool) {
+       odp_module_base_t base;
+
+       odp_api_proto(pool, capability) capability;
+       odp_api_proto(pool, create) create;
+       odp_api_proto(pool, destroy) destroy;
+       odp_api_proto(pool, lookup) lookup;
+       odp_api_proto(pool, info) info;
+       odp_api_proto(pool, print) print;
+       odp_api_proto(pool, to_u64) to_u64;
+       odp_api_proto(pool, param_init) param_init;
+} pool_module_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/pool/subsystem.c 
b/platform/linux-generic/pool/subsystem.c
new file mode 100644
index 00000000..35600399
--- /dev/null
+++ b/platform/linux-generic/pool/subsystem.c
@@ -0,0 +1,16 @@
+/* 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(pool, "memory pool public APIs", SUBSYSTEM_VERSION);
+
+ODP_SUBSYSTEM_CONSTRUCTOR(pool)
+{
+       odp_subsystem_constructor(pool);
+}

Reply via email to