Re: [lng-odp] [KEYSTONE2 PATCH 06/15] linux-ks2: init: fix a minimal library build

2015-03-11 Thread Maxim Uvarov

On 03/10/15 18:31, Taras Kondratiuk wrote:

  int odp_init_global(odp_init_t *params ODP_UNUSED,
  odp_platform_init_t *platform_params ODP_UNUSED)
  {
+   odp_proc.log_fn = odp_override_log;
+   odp_proc.abort_fn = odp_override_abort;
+
+   if (params != NULL) {
+   if (params-log_fn != NULL)
+   odp_proc.log_fn = params-log_fn;
+   if (params-abort_fn != NULL)
+   odp_proc.abort_fn = params-abort_fn;
+   }
+
odp_sy


remove ODP_UNUSED from params if you use them.

Maxim.

___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [KEYSTONE2 PATCH 06/15] linux-ks2: init: fix a minimal library build

2015-03-10 Thread Taras Kondratiuk
Signed-off-by: Taras Kondratiuk taras.kondrat...@linaro.org
Signed-off-by: Taras Kondratiuk ta...@ti.com
---
 platform/linux-keystone2/Makefile.am |  6 +-
 platform/linux-keystone2/include/odp.h   |  1 +
 platform/linux-keystone2/include/odp/plat/state.h|  3 +++
 platform/linux-keystone2/include/odp/plat/ti_mcsdk.h |  3 +++
 platform/linux-keystone2/include/odp_internal.h  |  8 +++-
 platform/linux-keystone2/mcsdk/mcsdk_init.c  | 10 +-
 platform/linux-keystone2/mcsdk/mcsdk_navig.c |  6 +++---
 platform/linux-keystone2/mcsdk/mcsdk_rmclient.c  |  4 ++--
 platform/linux-keystone2/mcsdk/sockutils.c   |  2 +-
 platform/linux-keystone2/odp_init.c  | 13 -
 10 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/platform/linux-keystone2/Makefile.am 
b/platform/linux-keystone2/Makefile.am
index e302414..a6ee070 100644
--- a/platform/linux-keystone2/Makefile.am
+++ b/platform/linux-keystone2/Makefile.am
@@ -137,6 +137,8 @@ __LIB__libodp_la_SOURCES = \
   mcsdk/sockutils.c \
   ../linux-generic/odp_barrier.c \
   ../linux-generic/odp_cpumask.c \
+  ../linux-generic/odp_errno.c \
+  ../linux-generic/odp_impl.c \
   ../linux-generic/odp_linux.c \
   ../linux-generic/odp_ring.c \
   ../linux-generic/odp_rwlock.c \
@@ -145,4 +147,6 @@ __LIB__libodp_la_SOURCES = \
   ../linux-generic/odp_system_info.c \
   ../linux-generic/odp_thread.c \
   ../linux-generic/odp_ticketlock.c \
-  ../linux-generic/odp_time.c
+  ../linux-generic/odp_time.c \
+  ../linux-generic/odp_version.c \
+  ../linux-generic/odp_weak.c
diff --git a/platform/linux-keystone2/include/odp.h 
b/platform/linux-keystone2/include/odp.h
index 6ab30a9..7526d93 100644
--- a/platform/linux-keystone2/include/odp.h
+++ b/platform/linux-keystone2/include/odp.h
@@ -40,6 +40,7 @@ extern C {
 #include odp/time.h
 #include odp/sync.h
 #include odp/rwlock.h
+#include odp/errno.h
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-keystone2/include/odp/plat/state.h 
b/platform/linux-keystone2/include/odp/plat/state.h
index 0b4b07f..63428cb 100644
--- a/platform/linux-keystone2/include/odp/plat/state.h
+++ b/platform/linux-keystone2/include/odp/plat/state.h
@@ -14,6 +14,7 @@ extern C {
 #endif
 
 #include odp/plat/ti_mcsdk.h
+#include odp/init.h
 
 /**
  * @internal Global ODP state
@@ -37,6 +38,8 @@ struct odp_proc_s {
} nwal; /** Per process NWAL state */
Rm_ServiceHandle *rm_service;   /** Resource Manager service handle */
void *descriptor_mem_base;
+   odp_log_func_t log_fn;
+   odp_abort_func_t abort_fn;
 };
 
 /** @internal Per thread ODP state */
diff --git a/platform/linux-keystone2/include/odp/plat/ti_mcsdk.h 
b/platform/linux-keystone2/include/odp/plat/ti_mcsdk.h
index 5ccc9e0..b8e002a 100644
--- a/platform/linux-keystone2/include/odp/plat/ti_mcsdk.h
+++ b/platform/linux-keystone2/include/odp/plat/ti_mcsdk.h
@@ -13,6 +13,9 @@
 extern C {
 #endif
 
+/* Define asm for C99 compatibility */
+#define asm __asm
+
 #include ti/csl/cslr_device.h
 #include ti/runtime/hplib/hplib.h
 #include ti/runtime/pktlib/pktlib.h
diff --git a/platform/linux-keystone2/include/odp_internal.h 
b/platform/linux-keystone2/include/odp_internal.h
index 7ebf567..816e74f 100644
--- a/platform/linux-keystone2/include/odp_internal.h
+++ b/platform/linux-keystone2/include/odp_internal.h
@@ -19,15 +19,19 @@
 extern C {
 #endif
 
-#include odp/plat/state.h
 #include odp/thread.h
 
+extern __thread int __odp_errno;
+
 int odp_system_info_init(void);
 
 int odp_thread_init_global(void);
 int odp_thread_init_local(void);
+int odp_thread_term_local(void);
+int odp_thread_term_global(void);
 
 int odp_shm_init_global(void);
+int odp_shm_term_global(void);
 int odp_shm_init_local(void);
 
 int odp_buffer_pool_init_global(void);
@@ -39,7 +43,9 @@ int odp_queue_init_global(void);
 int odp_crypto_init_global(void);
 
 int odp_schedule_init_global(void);
+int odp_schedule_term_global(void);
 int odp_schedule_init_local(void);
+int odp_schedule_term_local(void);
 
 int odp_timer_init_global(void);
 int odp_timer_disarm_all(void);
diff --git a/platform/linux-keystone2/mcsdk/mcsdk_init.c 
b/platform/linux-keystone2/mcsdk/mcsdk_init.c
index fbc9bb5..2c1407a 100644
--- a/platform/linux-keystone2/mcsdk/mcsdk_init.c
+++ b/platform/linux-keystone2/mcsdk/mcsdk_init.c
@@ -7,11 +7,11 @@
  */
 
 #include stdio.h
-#include odp_align.h
-#include odp_thread.h
+#include odp/align.h
+#include odp/thread.h
 #include odp_internal.h
-#include odp_ti_mcsdk.h
-#include odp_debug_internal.h
+#include