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 [thread overview]
Message-ID: <1409961977-11762-2-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>
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 <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
---
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__;
--
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
2014-09-06 0:06 ` behanw [this message]
2014-09-06 0:06 ` [PATCH v2 2/7] arm: LLVMLinux: Use current_stack_pointer to calculate pt_regs address behanw
2014-09-06 0:06 ` [PATCH v2 3/7] arm: LLVMLinux: Use current_stack_pointer for return_address behanw
2014-09-06 0:06 ` [PATCH v2 4/7] arm: LLVMLinux: Use current_stack_pointer in save_stack_trace_tsk behanw
2014-09-06 0:06 ` [PATCH v2 5/7] arm: LLVMLinux: Calculate current_thread_info from current_stack_pointer behanw
2014-09-06 0:06 ` [PATCH v2 6/7] arm: LLVMLinux: Use current_stack_pointer in unwind_backtrace behanw
2014-09-06 0:06 ` [PATCH v2 7/7] arm: LLVMLinux: Use global stack register variable for percpu behanw
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-2-git-send-email-behanw@converseincode.com \
--to=behanw@converseincode.com \
--cc=Dave.Martin@arm.com \
--cc=Nikolay.Borisov@arm.com \
--cc=a.ryabinin@samsung.com \
--cc=anurag19aggarwal@gmail.com \
--cc=charlebm@gmail.com \
--cc=cl@linux-foundation.org \
--cc=dave.long@linaro.org \
--cc=k.khlebnikov@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=linyongting@gmail.com \
--cc=rabin@rab.in \
--cc=rostedt@goodmis.org \
--cc=rric@kernel.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=will.deacon@arm.com \
/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
all inboxes | Powered by JetHome®