All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] x86: Readd asmregparm
@ 2011-06-08  1:09 Andi Kleen
  2011-06-08  1:10 ` [PATCH 2/3] x86: Add missing asmlinkages/asmregparm Andi Kleen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andi Kleen @ 2011-06-08  1:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, x86

From: Andi Kleen <ak@linux.intel.com>

For a followon patchkit of mine I need to mark all functions
that can be called from assembler. But on 32bit kernels some
assembler functions are called with register arguments and others
with stack arguments. asmlinkage forces stack arguments.

This patch readds the recently removed asmregparm to be able
to mark assembler functions called with register arguments on 32bit.

Unlike the old code it's x86 only now to prevent it from
leaking.

Cc: x86@kernel.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/include/asm/linkage.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index 4814297..fe10d95 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -8,6 +8,7 @@
 
 #ifdef CONFIG_X86_32
 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
+#define asmregparm CPP_ASMLINKAGE __attribute__((regparm(3)))
 
 /*
  * Make sure the compiler doesn't do anything stupid with the
@@ -42,7 +43,9 @@
 	__asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
 			      "g" (arg4), "g" (arg5), "g" (arg6))
 
-#endif /* CONFIG_X86_32 */
+#else
+#define asmregparm asmlinkage
+#endif /* !CONFIG_X86_32 */
 
 #ifdef __ASSEMBLY__
 
-- 
1.7.4.4


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

end of thread, other threads:[~2011-06-08 16:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08  1:09 [PATCH 1/3] x86: Readd asmregparm Andi Kleen
2011-06-08  1:10 ` [PATCH 2/3] x86: Add missing asmlinkages/asmregparm Andi Kleen
2011-06-08  1:10 ` [PATCH 3/3] x86: Change dotraplinkage into asmregparm for 32bit Andi Kleen
2011-06-08  8:19 ` [PATCH 1/3] x86: Readd asmregparm Ingo Molnar
2011-06-08  8:37   ` Andi Kleen
2011-06-08  8:53     ` Ingo Molnar
2011-06-08 11:57     ` Pekka Enberg
2011-06-08 12:28       ` Christoph Lameter
2011-06-08 16:01       ` Andi Kleen

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.