From patchwork Tue Jul 8 20:16:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 33254 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D8CD52070A for ; Tue, 8 Jul 2014 20:18:14 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id t59sf25908972yho.10 for ; Tue, 08 Jul 2014 13:18:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6mWcSbESnorUXNq1qcZrFInkc50XvKCe3ccTfCnfKhk=; b=Zo3n8eTR/6vPk+H7lZvTa8sp1iPbNj7AZQ59N7cPwui8Ux0pOc5GNxD0hR8GuPZ0c6 ZLjhatyHbugHJOUAuh6/CdjKX/bMF3U478TGtEVfiF6fifMH8pHj1EbeHQn11eyRJduU xDH3hdcCAJjddxoxj2h+9XJOs9DOANq8fQep521h9aZKBkVnNqiTE/G+n8siIHZxw/CG gltBqhGuaXrBFrD+V6NOcX/FW2+4Iayyzk+omsfLp5stI0ewcKp1db8NdLnWMvutTT0L jVBKiOb+XiplWybm7cTIbgiyO5/Phd3IfOv+Zb6r+r+liPqVym+ySBVh2/aIOvsxBikD qjFQ== X-Gm-Message-State: ALoCoQm9TlAcYO76RJXjl9riVMKrGgMv1zR7kexmHoNHswssuGEWnC9S5iQTppEmdSvIRDh6aEX1 X-Received: by 10.58.32.163 with SMTP id k3mr9902811vei.28.1404850694708; Tue, 08 Jul 2014 13:18:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.237 with SMTP id u100ls1741133qga.36.gmail; Tue, 08 Jul 2014 13:18:14 -0700 (PDT) X-Received: by 10.58.248.34 with SMTP id yj2mr2147154vec.43.1404850694519; Tue, 08 Jul 2014 13:18:14 -0700 (PDT) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id uc3si20609489vec.97.2014.07.08.13.18.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 13:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::232 as permitted sender) client-ip=2607:f8b0:400c:c01::232; Received: by mail-ve0-f178.google.com with SMTP id oy12so6355727veb.9 for ; Tue, 08 Jul 2014 13:18:14 -0700 (PDT) X-Received: by 10.52.13.98 with SMTP id g2mr1937284vdc.46.1404850694346; Tue, 08 Jul 2014 13:18:14 -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 tc5csp803429vcb; Tue, 8 Jul 2014 13:18:13 -0700 (PDT) X-Received: by 10.68.117.42 with SMTP id kb10mr26863447pbb.75.1404850693508; Tue, 08 Jul 2014 13:18:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si16035408pat.238.2014.07.08.13.18.12; Tue, 08 Jul 2014 13:18:12 -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 S932469AbaGHUSA (ORCPT + 27 others); Tue, 8 Jul 2014 16:18:00 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:56175 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932275AbaGHUQu (ORCPT ); Tue, 8 Jul 2014 16:16:50 -0400 Received: by mail-pd0-f181.google.com with SMTP id v10so7748734pde.12 for ; Tue, 08 Jul 2014 13:16:49 -0700 (PDT) X-Received: by 10.66.161.69 with SMTP id xq5mr36574517pab.62.1404850609609; Tue, 08 Jul 2014 13:16:49 -0700 (PDT) Received: from galdor.websterwood.com (S0106dc9fdb80cffd.gv.shawcable.net. [96.50.97.138]) by mx.google.com with ESMTPSA id v9sm25528039pdp.88.2014.07.08.13.16.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Jul 2014 13:16:48 -0700 (PDT) From: behanw@converseincode.com To: anurag19aggarwal@gmail.com, catalin.marinas@arm.com, charlebm@gmail.com, dave.long@linaro.org, k.khlebnikov@samsung.com, linux@arm.linux.org.uk, linyongting@gmail.com, Nikolay.Borisov@arm.com, tglx@linutronix.de, u.kleine-koenig@pengutronix.de, will.deacon@arm.com Cc: behanw@converseincode.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rabin@rab.in, rostedt@goodmis.org, dwmw2@infradead.org Subject: [PATCH 4/6] arm: LLVMLinux: Use current_stack_pointer in save_stack_trace_tsk Date: Tue, 8 Jul 2014 13:16:14 -0700 Message-Id: <1404850576-2006-5-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404850576-2006-1-git-send-email-behanw@converseincode.com> References: <1404850576-2006-1-git-send-email-behanw@converseincode.com> 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:c01::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 --- arch/arm/kernel/stacktrace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index f065eb0..92b7237 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@ -134,12 +134,10 @@ static noinline void __save_stack_trace(struct task_struct *tsk, frame.pc = thread_saved_pc(tsk); #endif } else { - register unsigned long current_sp asm ("sp"); - /* We don't want this function nor the caller */ data.skip += 2; 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)__save_stack_trace; }