[PATCH 1/3] x86: Readd asmregparm

From: Andi Kleen
Date: Tue Jun 07 2011 - 21:11:20 EST


From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

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@xxxxxxxxxx
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/