From patchwork Tue Nov 18 19:40:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 41085 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 6E17324035 for ; Tue, 18 Nov 2014 19:41:15 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gm9sf2712134lab.11 for ; Tue, 18 Nov 2014 11:41:14 -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:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=SL05Qyr/eMd8hgz5lv2dJXzTpW926YOh7+Jip76vzAs=; b=hnncYG6+t97qeeO7v2voSXeoLzuL5io+/0XD8JtUP9DBwdEC/4xLrUdMeHAl5QIjub Qq5d1RGXzP7g5DvRU70l/Q3n8MMFvDPWdotPRHZQGFFmeadmgzQ3aAtqHM+Hbwqd03K5 5pen+AQQ6BbaloeGWZcdx+dPIa8uzJE5F5ZM9sJuXEQcOdTyzhn9wUyxiQI0CnKUqfS3 GOrky+O+x/hDtE2ciGWFkQD6Eh1SAxVHW/UzBAYbv5dhF+9Tu3802Vu5EyhVuqiBNk2R Pup7ExmttaELGDBKEjEOUMlZC/Sudrz0yZyTvt08xs8ElHw8y8J0qMoxv4iTyod0BLa5 cTtQ== X-Gm-Message-State: ALoCoQnxXkluJ6sGCmxno0KDtYD4oPIyN4oX94o4oO4/FUf3Q6N1s+gXVxGKpCxRY+nOjZuRPOYm X-Received: by 10.112.151.38 with SMTP id un6mr11602878lbb.0.1416339674439; Tue, 18 Nov 2014 11:41:14 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.46 with SMTP id u14ls1255316laz.96.gmail; Tue, 18 Nov 2014 11:41:14 -0800 (PST) X-Received: by 10.152.29.41 with SMTP id g9mr946332lah.83.1416339674297; Tue, 18 Nov 2014 11:41:14 -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 ap3si56970775lbc.33.2014.11.18.11.41.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Nov 2014 11:41:14 -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 q1so1579788lam.30 for ; Tue, 18 Nov 2014 11:41:14 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr1050103lbc.34.1416339674120; Tue, 18 Nov 2014 11:41:14 -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.184.201 with SMTP id ew9csp1391390lbc; Tue, 18 Nov 2014 11:41:13 -0800 (PST) X-Received: by 10.224.40.147 with SMTP id k19mr46522536qae.59.1416339672792; Tue, 18 Nov 2014 11:41:12 -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 g2si17437944qas.95.2014.11.18.11.41.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 18 Nov 2014 11:41:12 -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 1Xqoe9-0007tK-Hd; Tue, 18 Nov 2014 19:41:05 +0000 Received: from mail-qg0-f41.google.com ([209.85.192.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xqody-0007t5-Fi for lng-odp@lists.linaro.org; Tue, 18 Nov 2014 19:40:54 +0000 Received: by mail-qg0-f41.google.com with SMTP id j5so3245428qga.0 for ; Tue, 18 Nov 2014 11:40:49 -0800 (PST) X-Received: by 10.140.22.71 with SMTP id 65mr27720678qgm.19.1416339648015; Tue, 18 Nov 2014 11:40:48 -0800 (PST) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id j11sm37808831qaa.47.2014.11.18.11.40.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Nov 2014 11:40:47 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 18 Nov 2014 14:40:40 -0500 Message-Id: <1416339640-11996-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] api: odp_hints.h add ODP_WEAK_SYMBOL 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 Several ODP APIs require that the application is able to replace them with a more appropriate definition. By defining an ODP function as weak the linker is able to replace the definition with the one supplied by the application. Signed-off-by: Mike Holmes Reviewed-by: Bill Fischofer --- platform/linux-generic/include/api/odp_hints.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/linux-generic/include/api/odp_hints.h b/platform/linux-generic/include/api/odp_hints.h index bc6d720..7f04886 100644 --- a/platform/linux-generic/include/api/odp_hints.h +++ b/platform/linux-generic/include/api/odp_hints.h @@ -25,6 +25,11 @@ extern "C" { #ifdef __GNUC__ +/** Define a weak symbol + * This is primarily useful in defining library functions that can be + * overridden in user code. + */ +#define ODP_WEAK_SYMBOL __attribute__((__weak__)) /** * Hot code section @@ -68,6 +73,7 @@ extern "C" { #else +#define ODP_WEAK_SYMBOL #define ODP_HOT_CODE #define ODP_COLD_CODE #define odp_likely(x)