From patchwork Wed Aug 27 04:29:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 36070 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9DBB820551 for ; Wed, 27 Aug 2014 04:30:40 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id et14sf130507066pad.6 for ; Tue, 26 Aug 2014 21:30:39 -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=jFAxdG2ixFzQ1mJXWKAL8RyarTQ1Ah5c2b+E/uJxGc8=; b=a1pwPpW6DqXafOLa3hFyZkFBHVdyMt2+cxOBqOpNxS3J3O6VXw1fJ25vWEPny+RiLM hEMibPjzIM7yNyptkV+deJomLPFBEAxu9I2Pb/tp4NiBIaesY1wW13q0FHL9zGoyPO+u mWcHhiIpaML8HGooB4CCEAZwvwR2W+Vlbg1wSJg7drBJfLsBN6G27wznqFltLiqS06UN vkayBRJK23k6vPeArrPzRUILqXecH4ZSxcpTAhLoZd5UGkv85IIcp+8OcU4dmPintZtc ZjXGotasY/rTwuf8l++Bo7ZJr2wTpQ//6sIOSPiRHJ0x5oLCzPnLEqacBbYOu4IhNhJR /YWg== X-Gm-Message-State: ALoCoQlkTjSULtxomzWLFSxV+vC7IHF3iOub4stT1IaOUDicLYWwrb440ck8qcZ7nLqR/jwwpnkh X-Received: by 10.70.41.230 with SMTP id i6mr20620754pdl.2.1409113839693; Tue, 26 Aug 2014 21:30:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.32.138 with SMTP id h10ls1432419qgh.87.gmail; Tue, 26 Aug 2014 21:30:39 -0700 (PDT) X-Received: by 10.236.51.73 with SMTP id a49mr48234323yhc.80.1409113839589; Tue, 26 Aug 2014 21:30:39 -0700 (PDT) Received: from mail-yk0-x232.google.com (mail-yk0-x232.google.com [2607:f8b0:4002:c07::232]) by mx.google.com with ESMTPS id c40si4010831yho.212.2014.08.26.21.30.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 21:30:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:4002:c07::232 as permitted sender) client-ip=2607:f8b0:4002:c07::232; Received: by mail-yk0-f178.google.com with SMTP id 142so12320485ykq.37 for ; Tue, 26 Aug 2014 21:30:39 -0700 (PDT) X-Received: by 10.220.182.1 with SMTP id ca1mr26994482vcb.21.1409113839504; Tue, 26 Aug 2014 21:30:39 -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 uj3csp27579vcb; Tue, 26 Aug 2014 21:30:38 -0700 (PDT) X-Received: by 10.70.51.103 with SMTP id j7mr12810964pdo.84.1409113838483; Tue, 26 Aug 2014 21:30:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qf4si7096188pbb.163.2014.08.26.21.30.37 for ; Tue, 26 Aug 2014 21:30:38 -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 S932693AbaH0E3x (ORCPT + 26 others); Wed, 27 Aug 2014 00:29:53 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:50847 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbaH0E3t (ORCPT ); Wed, 27 Aug 2014 00:29:49 -0400 Received: by mail-pa0-f46.google.com with SMTP id lj1so24809871pab.19 for ; Tue, 26 Aug 2014 21:29:48 -0700 (PDT) X-Received: by 10.70.129.162 with SMTP id nx2mr42024890pdb.73.1409113788766; Tue, 26 Aug 2014 21:29:48 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id dn5sm5029335pbb.2.2014.08.26.21.29.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 21:29:47 -0700 (PDT) From: behanw@converseincode.com To: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, cl@linux-foundation.org, jays.lee@samsung.com, k.khlebnikov@samsung.com, larry.bassel@linaro.org, olof@lixom.net, peterz@infradead.org, takahiro.akashi@linaro.org, tglx@linutronix.de, tj@kernel.org, will.deacon@arm.com Cc: christoffer.dall@linaro.org, kgene.kim@samsung.com, khilman@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sungjinn.chung@samsung.com, Behan Webster , Mark Charlebois Subject: [PATCH V2 3/6] arm64: LLVMLinux: Calculate current_thread_info from current_stack_pointer Date: Tue, 26 Aug 2014 21:29:31 -0700 Message-Id: <1409113774-3172-4-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409113774-3172-1-git-send-email-behanw@converseincode.com> References: <20140826141608.GT23445@arm.com> <1409113774-3172-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:4002:c07::232 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 Use the global current_stack_pointer to get the value of the stack pointer. This change supports being able to compile the kernel with both gcc and clang. Signed-off-by: Behan Webster Signed-off-by: Mark Charlebois Reviewed-by: Jan-Simon Möller Reviewed-by: Olof Johansson Acked-by: Will Deacon --- arch/arm64/include/asm/thread_info.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 356e037..459bf8e 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -80,8 +80,8 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__; static inline struct thread_info *current_thread_info(void) { - register unsigned long sp asm ("sp"); - return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); + return (struct thread_info *) + (current_stack_pointer & ~(THREAD_SIZE - 1)); } #define thread_saved_pc(tsk) \