From patchwork Tue Feb 3 11:35:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44219 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D84221513 for ; Tue, 3 Feb 2015 11:36:18 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf25212094wiv.0 for ; Tue, 03 Feb 2015 03:36:17 -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=ShdHHybJxdJ8ERhJehVEhKHm8pqXnk/6J9XgIy0E1gw=; b=PhDvs19uUFgO6S/ZJa/0eH+nM/A6mJTq5xQM/CrIq/29RFGaSOH4atFdsyswhwwFd7 1IyeI3orMewgp01X1Qq6V8gjJplrpBXNY/W07GUtz6MkPBkMeRTfQPMcyRo4d9pU3JPn jDpLZzlJrGKbYEuMxIbngGJh4a00wzepYqlIadbstCO59BOcPK8tbVuPM4WDprafJ7N6 5FJNLoTDF+sLgaNmwtfiHj9yLxiJzfxrI/iyqvNDnQsk1bJ2j2bEq5OOnCg+lD92Pv4c 4mnqxqPvpjFG6/QdL7EqikmgyoMo+xNdMcIgOwkqLKfjhymwGi8cuG7k5nrK84Rj2pC7 PCIA== X-Gm-Message-State: ALoCoQmFNhO/GfuJM9OXLhd/3/KKMGGILj6c48iBkOotCRBJEmZ0DXZL1RYjxKTPVdxqooJGGAwc X-Received: by 10.112.143.167 with SMTP id sf7mr3014153lbb.0.1422963377535; Tue, 03 Feb 2015 03:36:17 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.72 with SMTP id h8ls389702laa.46.gmail; Tue, 03 Feb 2015 03:36:17 -0800 (PST) X-Received: by 10.152.5.2 with SMTP id o2mr23967207lao.5.1422963377276; Tue, 03 Feb 2015 03:36:17 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id ls9si17631983lac.1.2015.02.03.03.36.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 03:36:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id pn19so4559240lab.2 for ; Tue, 03 Feb 2015 03:36:17 -0800 (PST) X-Received: by 10.112.243.12 with SMTP id wu12mr24126830lbc.91.1422963377152; Tue, 03 Feb 2015 03:36:17 -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.35.133 with SMTP id h5csp1879270lbj; Tue, 3 Feb 2015 03:36:16 -0800 (PST) X-Received: by 10.140.109.55 with SMTP id k52mr45032804qgf.99.1422963375683; Tue, 03 Feb 2015 03:36:15 -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 c9si28516599qaj.44.2015.02.03.03.36.14 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 03:36:15 -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 1YIbm8-0000I6-Q9; Tue, 03 Feb 2015 11:36:12 +0000 Received: from mail-qa0-f42.google.com ([209.85.216.42]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIblo-0000FT-I6 for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 11:35:52 +0000 Received: by mail-qa0-f42.google.com with SMTP id dc16so33299453qab.1 for ; Tue, 03 Feb 2015 03:35:47 -0800 (PST) X-Received: by 10.224.97.72 with SMTP id k8mr52189634qan.52.1422963347422; Tue, 03 Feb 2015 03:35:47 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id e88sm20973034qgf.22.2015.02.03.03.35.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 03:35:47 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 06:35:27 -0500 Message-Id: <1422963328-31760-5-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422963328-31760-1-git-send-email-mike.holmes@linaro.org> References: <1422963328-31760-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 4/5] api: init_global: allow abort fn to be overidden 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.43 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: Mike Holmes --- include/odp/api/init.h | 14 ++++++++++---- platform/linux-generic/odp_init.c | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/odp/api/init.h b/include/odp/api/init.h index c5b4e9b..6af032d 100644 --- a/include/odp/api/init.h +++ b/include/odp/api/init.h @@ -78,11 +78,16 @@ int odp_override_log(odp_log_level_e level, const char *fmt, ...); * Instead of directly calling abort, all abort calls in the implementation * should be done via this function or its wrappers. * - * An Application can override the ODP implementation default abort function - * odp_override_abort() by providing an alternative to this weak symbol. + * The application can provide this function to the ODP implementation in two + * ways: + * + * - A callback passed in via odp_init_t and odp_init_global() + * - By overriding the ODP implementation default abort function + * odp_override_abort(). * - * @warning The override option is not portable and GNU linker dependent - * (utilizes function attribute "weak"). + * @warning The latter option is less portable and GNU linker dependent + * (utilizes function attribute "weak"). If both are defined, the odp_init_t + * function pointer has priority over the override function. * * @warning this function shall not return */ @@ -101,6 +106,7 @@ typedef void (*odp_abort_func_t)(void) ODP_NORETURN; */ typedef struct odp_init_t { odp_log_func_t log_fn; + odp_abort_func_t abort_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 e91e910..74c893f 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -19,6 +19,8 @@ int odp_init_global(odp_init_t *params ODP_UNUSED, if (params != NULL) { if (params->log_fn != NULL) odp_global_data.log_fn = params->log_fn; + if (params->abort_fn != NULL) + odp_global_data.abort_fn = params->abort_fn; }