From patchwork Wed Mar 4 19:11:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45440 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 730962055F for ; Wed, 4 Mar 2015 19:14:20 +0000 (UTC) Received: by labhs14 with SMTP id hs14sf20580251lab.0 for ; Wed, 04 Mar 2015 11:14:19 -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:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=eWSFEIfs6ADte9MDDm3WpdM3PvvquVOqlW7HM+NXjzI=; b=dRh0JpjupSs4A/29ZPQ5R5IX55kDX0uA9A1o8x9WbOCdE/NqMtCpzn90oojN8QLJ+R CzWslIi9XTa2vqotVLz5q/noCDhfiQugft58YHX/wjAl2ruMcby3raxHuo9vQDIqTIkG jKMKenmhSKvQkox3c6Mrz74f5YJCjKbjXgzEUGtnFa6l3r7rbQJ/CIQO6Qs+mURnUFva 3f3W/U6gyFnrd0wm4cGveazYVrOZepW99nkNLgqf0qwxs2yluQNVzuILniMaXefRoAQ2 4ZiSTt0STXNPc75P3IsicwIfXrI/2qpNwXvJihlLwg5n4qL0TwDj+9JI+sPPs0A5Zeiy 2PkA== X-Gm-Message-State: ALoCoQmlphUMR3YNMVIefVgwJjI37oLNca0fob77d5uuNvygGXdy7eUjGDVzAn0olbgFYhspKiQm X-Received: by 10.194.63.208 with SMTP id i16mr953385wjs.2.1425496458852; Wed, 04 Mar 2015 11:14:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.167 with SMTP id dh7ls80910lac.101.gmail; Wed, 04 Mar 2015 11:14:18 -0800 (PST) X-Received: by 10.152.23.133 with SMTP id m5mr4665101laf.71.1425496458656; Wed, 04 Mar 2015 11:14:18 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id ax6si3089756lbc.65.2015.03.04.11.14.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 11:14:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbiw7 with SMTP id w7so7147346lbi.7 for ; Wed, 04 Mar 2015 11:14:18 -0800 (PST) X-Received: by 10.152.87.3 with SMTP id t3mr4825172laz.19.1425496458567; Wed, 04 Mar 2015 11:14:18 -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 h5csp31712lbj; Wed, 4 Mar 2015 11:14:17 -0800 (PST) X-Received: by 10.70.91.227 with SMTP id ch3mr9144049pdb.111.1425496456829; Wed, 04 Mar 2015 11:14:16 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id zh13si6355921pab.22.2015.03.04.11.14.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 11:14:16 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YTEiX-0005vo-4P; Wed, 04 Mar 2015 19:12:25 +0000 Received: from mail-wg0-f46.google.com ([74.125.82.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YTEi7-0005cW-Gy for linux-arm-kernel@lists.infradead.org; Wed, 04 Mar 2015 19:12:00 +0000 Received: by wghl2 with SMTP id l2so4913155wgh.8 for ; Wed, 04 Mar 2015 11:11:37 -0800 (PST) X-Received: by 10.194.200.229 with SMTP id jv5mr10987127wjc.59.1425496297473; Wed, 04 Mar 2015 11:11:37 -0800 (PST) Received: from ards-macbook-pro.local ([213.143.60.151]) by mx.google.com with ESMTPSA id ch6sm7224104wjc.3.2015.03.04.11.11.35 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 11:11:36 -0800 (PST) From: Ard Biesheuvel To: catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/4] arm64: add macros for common adrp usages Date: Wed, 4 Mar 2015 20:11:25 +0100 Message-Id: <1425496288-14483-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425496288-14483-1-git-send-email-ard.biesheuvel@linaro.org> References: <1425496288-14483-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150304_111159_704878_42649A13 X-CRM114-Status: UNSURE ( 8.24 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.46 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.46 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@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.173 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 The adrp instruction is mostly used in combination with either an add, a ldr or a str instruction with the low bits of the referenced symbol in the 12-bit immediate of the followup instruction. Introduce the macros adr_l, ldr_l and str_l that encapsulate these common patterns. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/assembler.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 750bac4e637e..14c30c58d101 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -159,4 +159,24 @@ lr .req x30 // link register orr \rd, \lbits, \hbits, lsl #32 .endm + .macro adr_l, dst, sym, tmp= + .ifb \tmp + adrp \dst, \sym + add \dst, \dst, :lo12:\sym + .else + adrp \tmp, \sym + add \dst, \tmp, :lo12:\sym + .endif + .endm + + .macro ldr_l, dst, sym, tmp + adrp \tmp, \sym + ldr \dst, [\sym, :lo12:\sym] + .endm + + .macro str_l, src, sym, tmp + adrp \tmp, \sym + str \src, [\tmp, :lo12:\sym] + .endm + #endif /* __ASM_ASSEMBLER_H */