From patchwork Sat Sep 6 00:06:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 36919 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CCA6D202A1 for ; Sat, 6 Sep 2014 00:06:57 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf107930356pab.9 for ; Fri, 05 Sep 2014 17:06:57 -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=932P15GC+DQPqqUreoDWMb/BiJEn8sAvVcABC5MLA3s=; b=EMl03qU0ZFshcQlBrOeB4BPthgZAKN1tFLDY3eS4luBU/dHWXrwX0NHmnAxb9mReIB uc7qtI9p0GPQlu1AtHwfiPDj+JKaFRzhnTTn6n+loMmmYhYP26lchkXEniATbHcjXlHc KbhXu0RPL/YD+W5zdlFvojbxmTebgjMMNqC5KNwUcjf00ly6uRB8OX5onvKAQHixTk9Y gipGMSjCLVPyO5QGut+JzBKSAFeN0ne/70UhVM7DwhjX84g2uqXuIw533yrn6LHiVirD MCtDin/4GJRY/V4PJYPTUNlGgtiEycDh1o5DoTMdG8NzUZrfXaUj4fC0MALOUdwnz5WM NKRA== X-Gm-Message-State: ALoCoQk31rnZI2o314L4xaph92Ww8EhUUnWEDKIkGFgN5EuPpPc7X9kjz8oV8YvkwtlUyjMtEj1C X-Received: by 10.66.168.197 with SMTP id zy5mr8963974pab.7.1409962017013; Fri, 05 Sep 2014 17:06:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.87 with SMTP id l81ls200501qga.51.gmail; Fri, 05 Sep 2014 17:06:56 -0700 (PDT) X-Received: by 10.52.146.17 with SMTP id sy17mr10880959vdb.29.1409962016891; Fri, 05 Sep 2014 17:06:56 -0700 (PDT) Received: from mail-vc0-x231.google.com (mail-vc0-x231.google.com [2607:f8b0:400c:c03::231]) by mx.google.com with ESMTPS id cu2si1562674vcb.107.2014.09.05.17.06.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 17:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::231 as permitted sender) client-ip=2607:f8b0:400c:c03::231; Received: by mail-vc0-f177.google.com with SMTP id hq11so12865017vcb.8 for ; Fri, 05 Sep 2014 17:06:56 -0700 (PDT) X-Received: by 10.220.166.68 with SMTP id l4mr13080325vcy.20.1409962016784; Fri, 05 Sep 2014 17:06:56 -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.45.67 with SMTP id uj3csp153503vcb; Fri, 5 Sep 2014 17:06:56 -0700 (PDT) X-Received: by 10.66.124.226 with SMTP id ml2mr26036228pab.142.1409962015882; Fri, 05 Sep 2014 17:06:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qy4si6510885pbb.64.2014.09.05.17.06.55 for ; Fri, 05 Sep 2014 17:06:55 -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 S1752707AbaIFAGx (ORCPT + 26 others); Fri, 5 Sep 2014 20:06:53 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:46237 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804AbaIFAGr (ORCPT ); Fri, 5 Sep 2014 20:06:47 -0400 Received: by mail-pa0-f50.google.com with SMTP id kq14so23262558pab.37 for ; Fri, 05 Sep 2014 17:06:46 -0700 (PDT) X-Received: by 10.70.130.195 with SMTP id og3mr26317538pdb.59.1409962006693; Fri, 05 Sep 2014 17:06:46 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id yx1sm2867621pab.5.2014.09.05.17.06.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Sep 2014 17:06:45 -0700 (PDT) From: behanw@converseincode.com To: a.ryabinin@samsung.com, anurag19aggarwal@gmail.com, charlebm@gmail.com, cl@linux-foundation.org, dave.long@linaro.org, k.khlebnikov@samsung.com, linux@arm.linux.org.uk, linyongting@gmail.com, Nikolay.Borisov@arm.com, tglx@linutronix.de, tj@kernel.org, u.kleine-koenig@pengutronix.de Cc: behanw@converseincode.com, Dave.Martin@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rabin@rab.in, rostedt@goodmis.org, rric@kernel.org, will.deacon@arm.com Subject: [PATCH v2 1/7] arm: LLVMLinux: Add global named register current_stack_pointer for ARM Date: Fri, 5 Sep 2014 17:06:11 -0700 Message-Id: <1409961977-11762-2-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409961977-11762-1-git-send-email-behanw@converseincode.com> References: <1409961977-11762-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::231 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/arm/include/asm/thread_info.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index fc44d37..bb43515 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -101,6 +101,11 @@ struct thread_info { #define init_stack (init_thread_union.stack) /* + * how to get the current stack pointer in 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__;