From: dl9pf@gmx.de
To: dl9pf@gmx.de
Cc: pageexec@freemail.hu, llvmlinux@lists.linuxfoundation.org,
behanw@converseincode.com, hpa@zytor.com,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] Extend definitions of _ASM_* with a raw format.
Date: Thu, 29 Aug 2013 21:13:04 +0200 [thread overview]
Message-ID: <1377803585-5913-2-git-send-email-dl9pf@gmx.de> (raw)
In-Reply-To: <1377803585-5913-1-git-send-email-dl9pf@gmx.de>
From: Jan-Simon Möller <dl9pf@gmx.de>
The __ASM_* macros (e.g. __ASM_DX) are used to return the proper
register name (e.g. edx for 32bit / rdx for 64bit). We want to use this
also in arch/x86/include/asm/uaccess.h / get_user() .
For this to work, we need a raw form as both gcc and clang choke on the
whitespace introduced by __ASM_FORM. Thus __ASM_FORM_RAW was added.
We change __ASM_REG to use the new RAW form.
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
CC: pageexec@freemail.hu
CC: llvmlinux@lists.linuxfoundation.org
CC: behanw@converseincode.com
CC: hpa@zytor.com
CC: linux-kernel@vger.kernel.org
---
arch/x86/include/asm/asm.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h
index 1c2d247..4582e8e 100644
--- a/arch/x86/include/asm/asm.h
+++ b/arch/x86/include/asm/asm.h
@@ -3,21 +3,25 @@
#ifdef __ASSEMBLY__
# define __ASM_FORM(x) x
+# define __ASM_FORM_RAW(x) x
# define __ASM_FORM_COMMA(x) x,
#else
# define __ASM_FORM(x) " " #x " "
+# define __ASM_FORM_RAW(x) #x
# define __ASM_FORM_COMMA(x) " " #x ","
#endif
#ifdef CONFIG_X86_32
# define __ASM_SEL(a,b) __ASM_FORM(a)
+# define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(a)
#else
# define __ASM_SEL(a,b) __ASM_FORM(b)
+# define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(b)
#endif
#define __ASM_SIZE(inst, ...) __ASM_SEL(inst##l##__VA_ARGS__, \
inst##q##__VA_ARGS__)
-#define __ASM_REG(reg) __ASM_SEL(e##reg, r##reg)
+#define __ASM_REG(reg) __ASM_SEL_RAW(e##reg, r##reg)
#define _ASM_PTR __ASM_SEL(.long, .quad)
#define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8)
--
1.8.1.4
next prev parent reply other threads:[~2013-08-29 19:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 17:13 [PATCH] [RFC] [X86] Fix a compilation issue with clang dl9pf
2013-08-29 17:28 ` H. Peter Anvin
2013-08-29 18:00 ` [llvmlinux] " Jan-Simon Möller
2013-08-29 18:11 ` H. Peter Anvin
2013-08-29 18:11 ` Jan-Simon Möller
2013-08-29 18:18 ` H. Peter Anvin
2013-08-29 18:23 ` Jan-Simon Möller
2013-08-29 18:31 ` H. Peter Anvin
2013-08-29 18:36 ` Jan-Simon Möller
2013-08-29 18:41 ` H. Peter Anvin
2013-08-29 19:13 ` dl9pf
2013-08-29 19:13 ` dl9pf [this message]
2013-08-29 20:30 ` [tip:x86/asm] x86, asm: Extend definitions of _ASM_* with a raw format tip-bot for Jan-Simon Möller
2013-08-29 19:13 ` [PATCH 2/2] [X86] Fix a compilation issue with clang dl9pf
2013-08-29 20:31 ` [tip:x86/asm] x86, asm: " tip-bot for Jan-Simon Möller
2013-08-29 20:42 ` [tip:x86/asm] x86, doc: Update uaccess.h comment to reflect clang changes tip-bot for H. Peter Anvin
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=1377803585-5913-2-git-send-email-dl9pf@gmx.de \
--to=dl9pf@gmx.de \
--cc=behanw@converseincode.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvmlinux@lists.linuxfoundation.org \
--cc=pageexec@freemail.hu \
/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
Powered by JetHome