From: behanw@converseincode.com (behanw at converseincode.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/7] arm: LLVMLinux: Use current_stack_pointer in save_stack_trace_tsk
Date: Fri, 5 Sep 2014 17:06:14 -0700 [thread overview]
Message-ID: <1409961977-11762-5-git-send-email-behanw@converseincode.com> (raw)
In-Reply-To: <1409961977-11762-1-git-send-email-behanw@converseincode.com>
From: Behan Webster <behanw@converseincode.com>
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 <behanw@converseincode.com>
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Jan-Simon M?ller <dl9pf@gmx.de>
---
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;
}
--
1.9.1
next prev parent reply other threads:[~2014-09-06 0:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-06 0:06 [PATCH v2 0/7] LLVMLinux: Patches to enable the kernel to be compiled with clang/LLVM behanw at converseincode.com
2014-09-06 0:06 ` [PATCH v2 1/7] arm: LLVMLinux: Add global named register current_stack_pointer for ARM behanw at converseincode.com
2014-09-06 0:06 ` [PATCH v2 2/7] arm: LLVMLinux: Use current_stack_pointer to calculate pt_regs address behanw at converseincode.com
2014-09-06 0:06 ` [PATCH v2 3/7] arm: LLVMLinux: Use current_stack_pointer for return_address behanw at converseincode.com
2014-09-06 0:06 ` behanw at converseincode.com [this message]
2014-09-06 0:06 ` [PATCH v2 5/7] arm: LLVMLinux: Calculate current_thread_info from current_stack_pointer behanw at converseincode.com
2014-09-06 0:06 ` [PATCH v2 6/7] arm: LLVMLinux: Use current_stack_pointer in unwind_backtrace behanw at converseincode.com
2014-09-06 0:06 ` [PATCH v2 7/7] arm: LLVMLinux: Use global stack register variable for percpu behanw at converseincode.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409961977-11762-5-git-send-email-behanw@converseincode.com \
--to=behanw@converseincode.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).