All of lore.kernel.org
 help / color / mirror / Atom feed
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 7/7] arm: LLVMLinux: Use global stack register variable for percpu
Date: Fri,  5 Sep 2014 17:06:17 -0700	[thread overview]
Message-ID: <1409961977-11762-8-git-send-email-behanw@converseincode.com> (raw)
In-Reply-To: <1409961977-11762-1-git-send-email-behanw@converseincode.com>

From: Mark Charlebois <charlebm@gmail.com>

Using global current_stack_pointer works on both clang and gcc.
current_stack_pointer is an unsigned long and needs to be cast
as a pointer to dereference.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
---
 arch/arm/include/asm/percpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/percpu.h b/arch/arm/include/asm/percpu.h
index 209e650..a89b407 100644
--- a/arch/arm/include/asm/percpu.h
+++ b/arch/arm/include/asm/percpu.h
@@ -30,14 +30,14 @@ static inline void set_my_cpu_offset(unsigned long off)
 static inline unsigned long __my_cpu_offset(void)
 {
 	unsigned long off;
-	register unsigned long *sp asm ("sp");
 
 	/*
 	 * Read TPIDRPRW.
 	 * We want to allow caching the value, so avoid using volatile and
 	 * instead use a fake stack read to hazard against barrier().
 	 */
-	asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*sp));
+	asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off)
+		: "Q" (*(const unsigned long *)current_stack_pointer));
 
 	return off;
 }
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: behanw@converseincode.com (behanw at converseincode.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 7/7] arm: LLVMLinux: Use global stack register variable for percpu
Date: Fri,  5 Sep 2014 17:06:17 -0700	[thread overview]
Message-ID: <1409961977-11762-8-git-send-email-behanw@converseincode.com> (raw)
In-Reply-To: <1409961977-11762-1-git-send-email-behanw@converseincode.com>

From: Mark Charlebois <charlebm@gmail.com>

Using global current_stack_pointer works on both clang and gcc.
current_stack_pointer is an unsigned long and needs to be cast
as a pointer to dereference.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
---
 arch/arm/include/asm/percpu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/percpu.h b/arch/arm/include/asm/percpu.h
index 209e650..a89b407 100644
--- a/arch/arm/include/asm/percpu.h
+++ b/arch/arm/include/asm/percpu.h
@@ -30,14 +30,14 @@ static inline void set_my_cpu_offset(unsigned long off)
 static inline unsigned long __my_cpu_offset(void)
 {
 	unsigned long off;
-	register unsigned long *sp asm ("sp");
 
 	/*
 	 * Read TPIDRPRW.
 	 * We want to allow caching the value, so avoid using volatile and
 	 * instead use a fake stack read to hazard against barrier().
 	 */
-	asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*sp));
+	asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off)
+		: "Q" (*(const unsigned long *)current_stack_pointer));
 
 	return off;
 }
-- 
1.9.1

  parent reply	other threads:[~2014-09-06  0:08 UTC|newest]

Thread overview: 16+ 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 at converseincode.com
2014-09-06  0:06 ` [PATCH v2 1/7] arm: LLVMLinux: Add global named register current_stack_pointer for ARM behanw
2014-09-06  0:06   ` 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
2014-09-06  0:06   ` behanw at converseincode.com
2014-09-06  0:06 ` [PATCH v2 3/7] arm: LLVMLinux: Use current_stack_pointer for return_address behanw
2014-09-06  0:06   ` behanw at converseincode.com
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   ` behanw at converseincode.com
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   ` behanw at converseincode.com
2014-09-06  0:06 ` [PATCH v2 6/7] arm: LLVMLinux: Use current_stack_pointer in unwind_backtrace behanw
2014-09-06  0:06   ` behanw at converseincode.com
2014-09-06  0:06 ` behanw [this message]
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-8-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.