From patchwork Tue Jan 20 23:37:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 43426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29891218DB for ; Tue, 20 Jan 2015 23:38:40 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id l18sf6460964wgh.3 for ; Tue, 20 Jan 2015 15:38:39 -0800 (PST) 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: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=fKGwR8khzx5ZQgodCCTHH73pmXG4VnBrjQNnSjHkU9k=; b=TIxBbocKnt+cp6uzxSjJWd/D8MWA0qAb/8Sp5y/uYEbyDyDKaqyDDQQaHOntC78VZr jOQNatbKxWdypw37v6kz67QVSWQdnCkV44CfccdLoso+dmPG6303fNFwl6AJi9GQzwO7 M6xbztDkopNIm3qEdokWsp71dZoUik4Kv7QVjgkP5XHXq7053Yqjr0zLSoN1yJOZ2Jfl I7xNCVUZX4DjkVCZ86Pa6GyEs4CUQhYpxUtPIcuwcm7XZSfJW5Kgltp4TiOCj5d3+Hw2 h+Er6sfr352aOB/jMQ/LVhCyGiP+7jBEKwSzOyZ99WoSsSM6fizM8KJjFFobiXatcK00 F5/w== X-Gm-Message-State: ALoCoQkgkN7JMk28s4kfGQEglQM0pUZOAGgh1/9ghuBZFSIZg05chdNhvXHDoizOmHCR69DVO2O1 X-Received: by 10.112.160.41 with SMTP id xh9mr1597lbb.12.1421797119080; Tue, 20 Jan 2015 15:38:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.201 with SMTP id x9ls844606lae.89.gmail; Tue, 20 Jan 2015 15:38:38 -0800 (PST) X-Received: by 10.152.206.41 with SMTP id ll9mr41537022lac.62.1421797118795; Tue, 20 Jan 2015 15:38:38 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id jb3si16470629lbc.79.2015.01.20.15.38.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 15:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id u10so5867069lbd.9 for ; Tue, 20 Jan 2015 15:38:38 -0800 (PST) X-Received: by 10.152.18.135 with SMTP id w7mr40067303lad.47.1421797118338; Tue, 20 Jan 2015 15:38:38 -0800 (PST) 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.9.200 with SMTP id c8csp1587230lbb; Tue, 20 Jan 2015 15:38:37 -0800 (PST) X-Received: by 10.140.44.34 with SMTP id f31mr35479656qga.3.1421797117170; Tue, 20 Jan 2015 15:38:37 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id u17si24374606qgd.7.2015.01.20.15.38.35 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Jan 2015 15:38:37 -0800 (PST) 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 1YDiNV-0003wr-W8; Tue, 20 Jan 2015 23:38:34 +0000 Received: from mail-qc0-f175.google.com ([209.85.216.175]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDiNN-0003wL-EZ for lng-odp@lists.linaro.org; Tue, 20 Jan 2015 23:38:25 +0000 Received: by mail-qc0-f175.google.com with SMTP id c9so11131279qcz.6 for ; Tue, 20 Jan 2015 15:38:20 -0800 (PST) X-Received: by 10.140.107.73 with SMTP id g67mr49227142qgf.103.1421797100260; Tue, 20 Jan 2015 15:38:20 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id 66sm8323596qgl.42.2015.01.20.15.38.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jan 2015 15:38:19 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 20 Jan 2015 18:37:56 -0500 Message-Id: <1421797078-14262-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421797078-14262-1-git-send-email-mike.holmes@linaro.org> References: <1421797078-14262-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 2/4] linux-generic: allow init_global to replace log fn 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: mike.holmes@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.178 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 Add the ability to pass in a new logging function as a pointer to init_global Signed-off-by: Mike Holmes --- platform/linux-generic/include/api/odp_init.h | 3 ++- platform/linux-generic/odp_init.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index 22ed88d..73c4a3b 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -29,7 +29,7 @@ extern "C" { #include - +#include /** @defgroup odp_initialization ODP INITIALIZATION * Initialisation operations. @@ -42,6 +42,7 @@ extern "C" { * level etc. */ typedef struct odp_init_t { + odp_log_func_t log_fn; } odp_init_t; /** ODP platform initialization data. diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 4f152ac..9815ecf 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -15,6 +15,12 @@ int odp_init_global(odp_init_t *params ODP_UNUSED, { odp_global_data.log_fn = odp_override_log; + if (params != NULL) { + if (params->log_fn != NULL) + odp_global_data.log_fn = params->log_fn; + } + + odp_system_info_init(); if (odp_shm_init_global()) {