From patchwork Sat Sep 6 00:06:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 36923 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E1A05202A1 for ; Sat, 6 Sep 2014 00:08:21 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id y10sf73103924pdj.0 for ; Fri, 05 Sep 2014 17:08:21 -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=2CHJqbeSuxtIpXGw9kgPMA7AWtzBblIrX7nNLukGSU4=; b=CUaGlVBrZ8K87nHH9KqVj12/3z2Kzc1T/IQzQKclST1EQo71juNlgC5RYGxSGsbftq ezO4ByL94IGIFco6OkoLH7bF8vdo9x2EZWMzFWfaOvsrxCs9L7gAYPRwJSEsukb/yc8B mXU8Tso24Ja2F4Nic5zT4ct34eJrYBeE1VvFeqfpAnzRUJlwPY2iN7TwLg/k3NULP948 Jm2hdRRUpsH9q+c9UypIpTu7hm4uwFCppWKSTTES+nS1Z/MgSoUaH7obMLR+TrWjGvDc 35WRC1fUDgYq7AXFpt1pN+fqh6y8SHahFGaTyQqvtM/aHiT1Ra9fkiP+B6Mna1UOD1lI lRBg== X-Gm-Message-State: ALoCoQk0eo4qjoQdUzsyOHugvzuW5Snq35fbMcvKigW3XKd+734JMkAaf7Hs+brojJ1tZwdpB2rm X-Received: by 10.66.142.229 with SMTP id rz5mr8925022pab.17.1409962101219; Fri, 05 Sep 2014 17:08:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.48 with SMTP id m45ls982648qgd.18.gmail; Fri, 05 Sep 2014 17:08:21 -0700 (PDT) X-Received: by 10.221.64.205 with SMTP id xj13mr4525437vcb.18.1409962101079; Fri, 05 Sep 2014 17:08:21 -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 um5si1584766vcb.53.2014.09.05.17.08.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 17:08:21 -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 hq11so12925092vcb.22 for ; Fri, 05 Sep 2014 17:08:21 -0700 (PDT) X-Received: by 10.221.44.69 with SMTP id uf5mr13091905vcb.4.1409962100964; Fri, 05 Sep 2014 17:08:20 -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 uj3csp153623vcb; Fri, 5 Sep 2014 17:08:20 -0700 (PDT) X-Received: by 10.68.224.40 with SMTP id qz8mr564699pbc.9.1409962099422; Fri, 05 Sep 2014 17:08:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ko1si6574538pbd.33.2014.09.05.17.08.18 for ; Fri, 05 Sep 2014 17:08:19 -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 S1753154AbaIFAIG (ORCPT + 26 others); Fri, 5 Sep 2014 20:08:06 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:47888 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbaIFAG7 (ORCPT ); Fri, 5 Sep 2014 20:06:59 -0400 Received: by mail-pa0-f44.google.com with SMTP id rd3so23415143pab.3 for ; Fri, 05 Sep 2014 17:06:58 -0700 (PDT) X-Received: by 10.70.100.227 with SMTP id fb3mr26371787pdb.137.1409962018830; Fri, 05 Sep 2014 17:06:58 -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.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Sep 2014 17:06:57 -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 6/7] arm: LLVMLinux: Use current_stack_pointer in unwind_backtrace Date: Fri, 5 Sep 2014 17:06:16 -0700 Message-Id: <1409961977-11762-7-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 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 --- arch/arm/kernel/unwind.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index a61a1df..caea23b 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c @@ -471,7 +471,6 @@ int unwind_frame(struct stackframe *frame) void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk) { struct stackframe frame; - register unsigned long current_sp asm ("sp"); pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk); @@ -485,7 +484,7 @@ void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk) frame.pc = regs->ARM_lr; } else if (tsk == current) { frame.fp = (unsigned long)__builtin_frame_address(0); - frame.sp = current_sp; + frame.sp = current_stack_pointer; frame.lr = (unsigned long)__builtin_return_address(0); frame.pc = (unsigned long)unwind_backtrace; } else {