[v10,20/30] linux-gen, include: switch std_clib.h to api+abi

Message ID 20171027125014.27313-21-dmitry.ereminsolenikov@linaro.org
State New
Headers show
Series
  • restructure headers for ABI-compat/platform-optimized modes
Related show

Commit Message

Dmitry Eremin-Solenikov Oct. 27, 2017, 12:50 p.m.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
 example/traffic_mgmt/odp_traffic_mgmt.c            |  1 +
 helper/test/linux/process.c                        |  2 ++
 helper/test/linux/pthread.c                        |  2 ++
 helper/threads.c                                   |  1 +
 include/Makefile.am                                |  1 +
 include/odp/api/std_clib.h                         | 24 ++++++++++++++++++++++
 platform/linux-generic/Makefile.am                 |  2 +-
 .../odp/api => include-abi/odp/api/abi}/std_clib.h | 17 ++++++++-------
 .../include/odp/api/plat/std_clib_inlines.h        |  1 -
 platform/linux-generic/odp_std_clib.c              |  1 +
 10 files changed, 41 insertions(+), 11 deletions(-)
 create mode 100644 include/odp/api/std_clib.h
 rename platform/linux-generic/{include/odp/api => include-abi/odp/api/abi}/std_clib.h (60%)

-- 
2.14.2

Patch

diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c
index 1f1102ddfdaf..e02a1af8dc3f 100644
--- a/example/traffic_mgmt/odp_traffic_mgmt.c
+++ b/example/traffic_mgmt/odp_traffic_mgmt.c
@@ -10,6 +10,7 @@ 
 
 #include <unistd.h>
 #include <signal.h>
+#include <string.h>
 #include <inttypes.h>
 #include <sys/resource.h>
 #include <execinfo.h>
diff --git a/helper/test/linux/process.c b/helper/test/linux/process.c
index 12504d01bd9f..3ed2032b0c59 100644
--- a/helper/test/linux/process.c
+++ b/helper/test/linux/process.c
@@ -11,6 +11,8 @@ 
 #include <odp/helper/linux/pthread.h>
 #include <odp/helper/linux/process.h>
 
+#include <string.h>
+
 #define NUMBER_WORKERS 16 /* 0 = max */
 
 static void *worker_fn(void *arg ODPH_UNUSED)
diff --git a/helper/test/linux/pthread.c b/helper/test/linux/pthread.c
index a50df027f3f2..0863283d60aa 100644
--- a/helper/test/linux/pthread.c
+++ b/helper/test/linux/pthread.c
@@ -10,6 +10,8 @@ 
 #include <odp_api.h>
 #include <odp/helper/linux/pthread.h>
 
+#include <string.h>
+
 #define NUMBER_WORKERS 16
 static void *worker_fn(void *arg ODPH_UNUSED)
 {
diff --git a/helper/threads.c b/helper/threads.c
index a83014d424de..32a092825084 100644
--- a/helper/threads.c
+++ b/helper/threads.c
@@ -10,6 +10,7 @@ 
 #define _GNU_SOURCE
 #endif
 #include <sched.h>
+#include <string.h>
 #include <unistd.h>
 #include <sys/wait.h>
 #include <sys/prctl.h>
diff --git a/include/Makefile.am b/include/Makefile.am
index 229f47fc7173..6b3d12f793a4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -22,6 +22,7 @@  odpapiinclude_HEADERS = \
 	odp/api/shared_memory.h \
 	odp/api/spinlock.h \
 	odp/api/spinlock_recursive.h \
+	odp/api/std_clib.h \
 	odp/api/std_types.h \
 	odp/api/thread.h \
 	odp/api/thrmask.h \
diff --git a/include/odp/api/std_clib.h b/include/odp/api/std_clib.h
new file mode 100644
index 000000000000..fde1c1dd3a4a
--- /dev/null
+++ b/include/odp/api/std_clib.h
@@ -0,0 +1,24 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_API_STD_CLIB_H_
+#define ODP_API_STD_CLIB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/std_types.h>
+
+#include <odp/api/abi/std_clib.h>
+
+#include <odp/api/spec/std_clib.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 966fc13f5c02..cdb45d8e0c9a 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -36,7 +36,6 @@  odpapiinclude_HEADERS = \
 		  include/odp/api/packet_io.h \
 		  include/odp/api/packet_io_stats.h \
 		  include/odp/api/random.h \
-		  include/odp/api/std_clib.h \
 		  include/odp/api/support.h \
 		  include/odp/api/sync.h \
 		  include/odp/api/system_info.h \
@@ -84,6 +83,7 @@  odpapiabiarchinclude_HEADERS = \
 		  include-abi/odp/api/abi/shared_memory.h \
 		  include-abi/odp/api/abi/spinlock.h \
 		  include-abi/odp/api/abi/spinlock_recursive.h \
+		  include-abi/odp/api/abi/std_clib.h \
 		  include-abi/odp/api/abi/std_types.h \
 		  include-abi/odp/api/abi/thread.h \
 		  include-abi/odp/api/abi/thrmask.h \
diff --git a/platform/linux-generic/include/odp/api/std_clib.h b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
similarity index 60%
rename from platform/linux-generic/include/odp/api/std_clib.h
rename to platform/linux-generic/include-abi/odp/api/abi/std_clib.h
index fea4725437e7..b31034df4705 100644
--- a/platform/linux-generic/include/odp/api/std_clib.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
@@ -4,22 +4,21 @@ 
  * SPDX-License-Identifier:     BSD-3-Clause
  */
 
-#ifndef ODP_PLAT_STD_CLIB_H_
-#define ODP_PLAT_STD_CLIB_H_
+/**
+ * @file
+ *
+ * ODP barrier
+ */
+
+#ifndef ODP_API_ABI_STD_CLIB_H_
+#define ODP_API_ABI_STD_CLIB_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <odp/api/spec/std_types.h>
-#include <string.h>
-
 #include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
 #include <odp/api/plat/std_clib_inlines.h>
-#endif
-
-#include <odp/api/spec/std_clib.h>
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h
index 8f505d079c33..bb6f9d02b29e 100644
--- a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h
@@ -11,7 +11,6 @@ 
 extern "C" {
 #endif
 
-#include <odp/api/spec/std_types.h>
 #include <string.h>
 
 _ODP_INLINE void *odp_memcpy(void *dst, const void *src, size_t num)
diff --git a/platform/linux-generic/odp_std_clib.c b/platform/linux-generic/odp_std_clib.c
index ed7c6446b556..38406b86b3c4 100644
--- a/platform/linux-generic/odp_std_clib.c
+++ b/platform/linux-generic/odp_std_clib.c
@@ -7,6 +7,7 @@ 
 #include "config.h"
 
 #include <odp/api/std_clib.h>
+#include <odp/api/plat/static_inline.h>
 #if ODP_ABI_COMPAT == 1
 #include <odp/api/plat/std_clib_inlines.h>
 #endif