From patchwork Mon Jan 19 01:56:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 43283 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF76C2034D for ; Mon, 19 Jan 2015 01:57:06 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id pv20sf1492813lab.3 for ; Sun, 18 Jan 2015 17:57:05 -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=Z+xFyfOA/P8QlJ8bLt/MQMF1KZSXXzvYfU8cBprQsLE=; b=VaWO5bOjzzW0ii5C/A2Clim/xHrnGR8u171t/RNJd02a46xg+spt+QgFsOfL7w2dqH 8jwCRXpyqSzCwq3Xt28FYkFT3WC2GgWrXga2bxo1Xy8OVkxQPmjSZYJ7PXYgd6KNUpqr T+HMrTkPux+jSHA1j+ZxsiDf+ym8xijrcLjwL9ZsefjU4gFw48zfuaYXtGZdAnBRRmFO HBWWMlA5efsb0r16h3CQrjz0XGbVkYO+TYbAVpic4ffwUeKvxQ6ECZP16khmxaS675Cn NOMj75FkDjM1wGmsp7D+CDSZ3M24DJ81BjQsq+98qjF4Mki8GTQ8RqgG6rAcHHNhLXWf mQYA== X-Gm-Message-State: ALoCoQmNiovIf+Z5KeXUK0quDm+35SYjxPDhVzZoaYDEC16v7oHaLZo3RE7SDDM6v4PmzBaEmlwo X-Received: by 10.180.89.211 with SMTP id bq19mr1689198wib.4.1421632625593; Sun, 18 Jan 2015 17:57:05 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.39 with SMTP id s7ls588101lae.20.gmail; Sun, 18 Jan 2015 17:57:05 -0800 (PST) X-Received: by 10.112.30.42 with SMTP id p10mr20591573lbh.70.1421632625419; Sun, 18 Jan 2015 17:57:05 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id un3si9633912lbb.21.2015.01.18.17.57.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Jan 2015 17:57:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so26330927lab.7 for ; Sun, 18 Jan 2015 17:57:05 -0800 (PST) X-Received: by 10.112.26.135 with SMTP id l7mr26657634lbg.56.1421632625205; Sun, 18 Jan 2015 17:57:05 -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 c8csp945737lbb; Sun, 18 Jan 2015 17:57:04 -0800 (PST) X-Received: by 10.224.16.131 with SMTP id o3mr44238520qaa.31.1421632623861; Sun, 18 Jan 2015 17:57:03 -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 y34si15504653qgy.28.2015.01.18.17.57.02 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 18 Jan 2015 17:57:03 -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 1YD1aP-0007MK-3w; Mon, 19 Jan 2015 01:57:01 +0000 Received: from mail-qa0-f53.google.com ([209.85.216.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YD1aB-0007L5-Eg for lng-odp@lists.linaro.org; Mon, 19 Jan 2015 01:56:47 +0000 Received: by mail-qa0-f53.google.com with SMTP id n4so22215805qaq.12 for ; Sun, 18 Jan 2015 17:56:42 -0800 (PST) X-Received: by 10.224.165.77 with SMTP id h13mr6866886qay.14.1421632602327; Sun, 18 Jan 2015 17:56:42 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id u15sm9532139qag.21.2015.01.18.17.56.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Jan 2015 17:56:41 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Sun, 18 Jan 2015 20:56:22 -0500 Message-Id: <1421632584-26181-3-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421632584-26181-1-git-send-email-mike.holmes@linaro.org> References: <1421632584-26181-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 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.215.48 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 a9f003f..c1539cf 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()) {