From patchwork Tue Mar 10 15:31:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 45587 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6CA6C214BF for ; Tue, 10 Mar 2015 15:32:08 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf2073840lbi.2 for ; Tue, 10 Mar 2015 08:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=2gagMPq5lbdA+W7At/9fxyKObNntKgjX4zPKUn5t8Lc=; b=N4Q8IM4cx9TVZQR+eMJ5ioxz5Irp+1wGweww9u2p7eisV+1UKV/IZ3iG3tCGy2zV2d ssKwinpMH8Ke70rMwbiBMa05R/XihMabXRoLbt0Cxhee/3s9JkZrLSQo7io2dzRQrWBO 3ZVJcQ+/ql/86FoL/+zUrKdpl4sS56Vm/DhdwIOp9cPc5Yaaz6jMEXfEHDJDTnTatybu jQ/TcqUEhzoZinT4SGSp7oCWr9krwbWQYr109bbLxpYr2JHrIjzvJsPYEgBdAruYb2k6 o3BPOXba1OulV1RRyaEtcWV12oOgzzVFhAqUNl9gp9/muvbYPh4SJSEHHjf3bDZ4Z+s9 pB0w== X-Gm-Message-State: ALoCoQm6Pm+HCorwekkbie32yrGf6udKCaShXaDblPbb2598l8y/AoTgMzDEKQqnmGWFGfOsycXG X-Received: by 10.152.164.171 with SMTP id yr11mr1885717lab.4.1426001527454; Tue, 10 Mar 2015 08:32:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.33 with SMTP id s1ls65300lae.40.gmail; Tue, 10 Mar 2015 08:32:07 -0700 (PDT) X-Received: by 10.152.184.73 with SMTP id es9mr15689518lac.104.1426001527301; Tue, 10 Mar 2015 08:32:07 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id gd8si566356lbc.67.2015.03.10.08.32.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 08:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbvp9 with SMTP id p9so2557654lbv.8 for ; Tue, 10 Mar 2015 08:32:07 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr30451456lbb.41.1426001527175; Tue, 10 Mar 2015 08:32:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2206733lbj; Tue, 10 Mar 2015 08:32:06 -0700 (PDT) X-Received: by 10.140.150.21 with SMTP id 21mr43560621qhw.69.1426001519805; Tue, 10 Mar 2015 08:31:59 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id 34si721742qkx.118.2015.03.10.08.31.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Mar 2015 08:31:59 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YVM8S-0003sW-ME; Tue, 10 Mar 2015 15:31:56 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YVM83-0003p3-Cm for lng-odp@lists.linaro.org; Tue, 10 Mar 2015 15:31:31 +0000 Received: by lamq1 with SMTP id q1so2484558lam.12 for ; Tue, 10 Mar 2015 08:31:25 -0700 (PDT) X-Received: by 10.112.146.129 with SMTP id tc1mr9127996lbb.27.1426001485606; Tue, 10 Mar 2015 08:31:25 -0700 (PDT) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id a2sm106609lbm.32.2015.03.10.08.31.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 08:31:25 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Tue, 10 Mar 2015 17:31:04 +0200 Message-Id: <1426001473-14618-7-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426001473-14618-1-git-send-email-taras.kondratiuk@linaro.org> References: <1426001473-14618-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Cc: Taras Kondratiuk Subject: [lng-odp] [KEYSTONE2 PATCH 06/15] linux-ks2: init: fix a minimal library build X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Taras Kondratiuk Signed-off-by: Taras Kondratiuk --- 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 #include #include +#include #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 +#include /** * @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 #include #include 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 #include +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 -#include -#include +#include +#include #include -#include -#include +#include +#include /* Global variables to hold virtual address of various subsystems */ hplib_virtualAddrInfo_T odp_vm_info; @@ -710,7 +710,7 @@ void odp_print_mem(void *addr, size_t size, const char *desc) start_ptr = addr; end_ptr = start_ptr + size; - ptr = (typeof(ptr))(((uintptr_t)start_ptr) & ~0xF); + ptr = (__typeof__(ptr))(((uintptr_t)start_ptr) & ~0xF); while (ptr < end_ptr) { printf("0x%08x: ", (unsigned int)ptr); diff --git a/platform/linux-keystone2/mcsdk/mcsdk_navig.c b/platform/linux-keystone2/mcsdk/mcsdk_navig.c index bdfc8e1..c3009b7 100644 --- a/platform/linux-keystone2/mcsdk/mcsdk_navig.c +++ b/platform/linux-keystone2/mcsdk/mcsdk_navig.c @@ -13,10 +13,10 @@ #include #include #include -#include +#include -#include -#include +#include +#include extern Qmss_GlobalConfigParams qmssGblCfgParams; extern Cppi_GlobalConfigParams cppiGblCfgParams; diff --git a/platform/linux-keystone2/mcsdk/mcsdk_rmclient.c b/platform/linux-keystone2/mcsdk/mcsdk_rmclient.c index c42c691..689de1d 100644 --- a/platform/linux-keystone2/mcsdk/mcsdk_rmclient.c +++ b/platform/linux-keystone2/mcsdk/mcsdk_rmclient.c @@ -17,8 +17,8 @@ #include #include -#include -#include +#include +#include /* Socket Includes */ #include "sockutils.h" diff --git a/platform/linux-keystone2/mcsdk/sockutils.c b/platform/linux-keystone2/mcsdk/sockutils.c index b31e8cc..d4d93fc 100644 --- a/platform/linux-keystone2/mcsdk/sockutils.c +++ b/platform/linux-keystone2/mcsdk/sockutils.c @@ -17,7 +17,7 @@ #include #include "sockutils.h" -#include "odp_debug_internal.h" +#include typedef struct sock_data { struct sockaddr_un addr; diff --git a/platform/linux-keystone2/odp_init.c b/platform/linux-keystone2/odp_init.c index 4e9783d..1fde2ce 100644 --- a/platform/linux-keystone2/odp_init.c +++ b/platform/linux-keystone2/odp_init.c @@ -7,8 +7,9 @@ */ #include -#include +#include #include +#include #include struct odp_global_s *odp_global; @@ -18,6 +19,16 @@ __thread struct odp_local_s odp_local; 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_system_info_init(); if (odp_shm_init_global()) {