From patchwork Wed Jul 30 23:57:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 34562 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3C81E20792 for ; Wed, 30 Jul 2014 23:57:54 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf7050317yha.3 for ; Wed, 30 Jul 2014 16:57:53 -0700 (PDT) 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:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=tYLpNgabRBCtzo9gvJBKFKgOcrV3Dg2otg3pJ6CQLY4=; b=K9I9VCbbNEPdJ5mSzT7eUBJYvFHCoUAk+JFjSmavP0awFQD/wzrHhaLUx/bfnKevx3 tUg1qa2pMqlE5PbaQTm2rTBhedz8FeJBtuXvb+UDWrL9kz7m1HN8c5W4zDC3SGD0JQJD ChYVVWUJ4dZP0hzjh4A1sicwjruWEBq6ZSNecr4tM0hinpHSZ2VmDDKWO+UscG3/8Jtf i7sML5Txl/hHni91Ygg79kJHkhw8kM4dRiTtpOfXGBR71BLc4LVKET26z9F/jH4G/wUX wfZVaqByZFD87CfuyrI7c9EMU9MgNGHo8PlCNz43TMqTAuH66dfvqmoF7uQql5eAqenG B+Hg== X-Gm-Message-State: ALoCoQn6do9HikcTsL2AuOFyzmIdZ5TbcRLkWhid3b6B0m7yzPB6WrFfGB+0VY88F//rt+TXFijG X-Received: by 10.236.99.8 with SMTP id w8mr144238yhf.31.1406764673317; Wed, 30 Jul 2014 16:57:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.85 with SMTP id s79ls818249qgd.22.gmail; Wed, 30 Jul 2014 16:57:53 -0700 (PDT) X-Received: by 10.52.164.199 with SMTP id ys7mr11812553vdb.42.1406764673205; Wed, 30 Jul 2014 16:57:53 -0700 (PDT) Received: from mail-vc0-x233.google.com (mail-vc0-x233.google.com [2607:f8b0:400c:c03::233]) by mx.google.com with ESMTPS id uy6si3172145vcb.23.2014.07.30.16.57.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 16:57:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::233 as permitted sender) client-ip=2607:f8b0:400c:c03::233; Received: by mail-vc0-f179.google.com with SMTP id hq11so3045056vcb.24 for ; Wed, 30 Jul 2014 16:57:53 -0700 (PDT) X-Received: by 10.52.244.138 with SMTP id xg10mr11548829vdc.40.1406764673052; Wed, 30 Jul 2014 16:57:53 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp64793vcb; Wed, 30 Jul 2014 16:57:52 -0700 (PDT) X-Received: by 10.70.126.98 with SMTP id mx2mr8244645pdb.41.1406764672225; Wed, 30 Jul 2014 16:57:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dw8si3913766pab.180.2014.07.30.16.57.51 for ; Wed, 30 Jul 2014 16:57:52 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755962AbaG3X5u (ORCPT + 24 others); Wed, 30 Jul 2014 19:57:50 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:46314 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755091AbaG3X5q (ORCPT ); Wed, 30 Jul 2014 19:57:46 -0400 Received: by mail-pa0-f50.google.com with SMTP id et14so2432488pad.23 for ; Wed, 30 Jul 2014 16:57:46 -0700 (PDT) X-Received: by 10.66.136.131 with SMTP id qa3mr355369pab.77.1406764665988; Wed, 30 Jul 2014 16:57:45 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id fm12sm5379301pdb.46.2014.07.30.16.57.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Jul 2014 16:57:44 -0700 (PDT) From: behanw@converseincode.com To: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, k.khlebnikov@samsung.com, olof@lixom.net, peterz@infradead.org, takahiro.akashi@linaro.org, tglx@linutronix.de, will.deacon@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mingo@kernel.org, dwmw2@infradead.org, Behan Webster Subject: [PATCH 1/4] arm64: LLVMLinux: Add current_stack_pointer() for arm64 Date: Wed, 30 Jul 2014 16:57:26 -0700 Message-Id: <1406764649-20326-2-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1406764649-20326-1-git-send-email-behanw@converseincode.com> References: <1406764649-20326-1-git-send-email-behanw@converseincode.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::233 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@ Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Behan Webster Define a global named register for current_stack_pointer. The use of this new variable guarantees that both gcc and clang can access this register in C code. Signed-off-by: Behan Webster Reviewed-by: Jan-Simon Möller Reviewed-by: Mark Charlebois --- arch/arm64/include/asm/thread_info.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index e40b6d0..e6b6094 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -69,6 +69,11 @@ struct thread_info { #define init_stack (init_thread_union.stack) /* + * how to get the current stack pointer from C + */ +register unsigned long current_stack_pointer asm ("sp"); + +/* * how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) __attribute_const__;