From: Andi Kleen <andi@firstfloor.org>
To: linux-kernel@vger.kernel.org
Cc: Andi Kleen <ak@linux.intel.com>, x86@kernel.org
Subject: [PATCH 1/3] x86: Readd asmregparm
Date: Tue, 7 Jun 2011 18:09:59 -0700 [thread overview]
Message-ID: <1307495401-2631-1-git-send-email-andi@firstfloor.org> (raw)
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
next reply other threads:[~2011-06-08 1:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 1:09 Andi Kleen [this message]
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
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=1307495401-2631-1-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/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