All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: LLVMLinux: Use __builtin_frame_address to get thread info
@ 2013-09-06 21:47 ` behanw at converseincode.com
  0 siblings, 0 replies; 4+ messages in thread
From: behanw @ 2013-09-06 21:47 UTC (permalink / raw)
  To: linux, linux-arm-kernel, linux-kernel
  Cc: behanw, Russell King, Will Deacon, Wade Farnsworth, Will Drewry

From: Behan Webster <behanw@converseincode.com>

The LLVMLinux Project is working to be able to build the Linux kernel with
clang/LLVM. With the release of LLVM 3.3 clang is now able to compile the Linux
kernel with a number of small patches (available from the LLVMLinux git repo).

Use the frame pointer to calculate the start of the stack for current_thread_info()
The existing code uses the stack pointer to do this calculation.
Using the frame pointer yeilds the same value in a portable way.
This change supports being able to compile the kernel with gcc and Clang.

Behan Webster (1):
  arm: LLVMLinux: Calculate current_thread_info from fp

 arch/arm/include/asm/thread_info.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: LLVMLinux: Use __builtin_frame_address to get thread info
@ 2013-09-06 21:47 ` behanw at converseincode.com
  0 siblings, 0 replies; 4+ messages in thread
From: behanw at converseincode.com @ 2013-09-06 21:47 UTC (permalink / raw)
  To: linux-arm-kernel

From: Behan Webster <behanw@converseincode.com>

The LLVMLinux Project is working to be able to build the Linux kernel with
clang/LLVM. With the release of LLVM 3.3 clang is now able to compile the Linux
kernel with a number of small patches (available from the LLVMLinux git repo).

Use the frame pointer to calculate the start of the stack for current_thread_info()
The existing code uses the stack pointer to do this calculation.
Using the frame pointer yeilds the same value in a portable way.
This change supports being able to compile the kernel with gcc and Clang.

Behan Webster (1):
  arm: LLVMLinux: Calculate current_thread_info from fp

 arch/arm/include/asm/thread_info.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: LLVMLinux: Calculate current_thread_info from fp
  2013-09-06 21:47 ` behanw at converseincode.com
@ 2013-09-06 21:47   ` behanw at converseincode.com
  -1 siblings, 0 replies; 4+ messages in thread
From: behanw @ 2013-09-06 21:47 UTC (permalink / raw)
  To: linux
  Cc: behanw, Mark Charlebois, Will Deacon, Wade Farnsworth,
	Will Drewry, moderated list:ARM PORT, open list

From: Behan Webster <behanw@converseincode.com>

Use the frame pointer to calculate the start of the stack for current_thread_info()
The existing code uses the stack pointer to do this calculation.
Using the frame pointer yeilds the same value in a portable way.
This change supports being able to compile the kernel with gcc and Clang.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
---
 arch/arm/include/asm/thread_info.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index df5e13d..cb50933 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -106,8 +106,9 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__;
 
 static inline struct thread_info *current_thread_info(void)
 {
-	register unsigned long sp asm ("sp");
-	return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
+	return (struct thread_info *)
+		((u32)(__builtin_frame_address(0))
+		& ~(THREAD_SIZE - 1));
 }
 
 #define thread_saved_pc(tsk)	\
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm: LLVMLinux: Calculate current_thread_info from fp
@ 2013-09-06 21:47   ` behanw at converseincode.com
  0 siblings, 0 replies; 4+ messages in thread
From: behanw at converseincode.com @ 2013-09-06 21:47 UTC (permalink / raw)
  To: linux-arm-kernel

From: Behan Webster <behanw@converseincode.com>

Use the frame pointer to calculate the start of the stack for current_thread_info()
The existing code uses the stack pointer to do this calculation.
Using the frame pointer yeilds the same value in a portable way.
This change supports being able to compile the kernel with gcc and Clang.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon M?ller <dl9pf@gmx.de>
---
 arch/arm/include/asm/thread_info.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index df5e13d..cb50933 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -106,8 +106,9 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__;
 
 static inline struct thread_info *current_thread_info(void)
 {
-	register unsigned long sp asm ("sp");
-	return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
+	return (struct thread_info *)
+		((u32)(__builtin_frame_address(0))
+		& ~(THREAD_SIZE - 1));
 }
 
 #define thread_saved_pc(tsk)	\
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-06 21:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-06 21:47 [PATCH] arm: LLVMLinux: Use __builtin_frame_address to get thread info behanw
2013-09-06 21:47 ` behanw at converseincode.com
2013-09-06 21:47 ` [PATCH] arm: LLVMLinux: Calculate current_thread_info from fp behanw
2013-09-06 21:47   ` behanw at converseincode.com

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.