diff options
author | Jan-Simon Möller <dl9pf@gmx.de> | 2013-08-29 15:13:04 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-08-29 16:26:32 -0400 |
commit | 3e9b2327b59801e677a7581fe4d2541ca749dcab (patch) | |
tree | 8da66aebe0d47bb80bc2dc1f10adab07a8e6e1c9 /arch | |
parent | 3e21bb092d07e6d394e6d754057d4ff2d363d318 (diff) |
x86, asm: Extend definitions of _ASM_* with a raw format
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 in a register asm() statement, and the __ASM_FORM macro
surrounds the argument with blanks. A new macro, __ASM_FORM_RAW was
added and we change __ASM_REG to use the new RAW form.
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Link: http://lkml.kernel.org/r/1377803585-5913-2-git-send-email-dl9pf@gmx.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/asm.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index 1c2d247f65ce..4582e8e1cd1a 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h | |||
@@ -3,21 +3,25 @@ | |||
3 | 3 | ||
4 | #ifdef __ASSEMBLY__ | 4 | #ifdef __ASSEMBLY__ |
5 | # define __ASM_FORM(x) x | 5 | # define __ASM_FORM(x) x |
6 | # define __ASM_FORM_RAW(x) x | ||
6 | # define __ASM_FORM_COMMA(x) x, | 7 | # define __ASM_FORM_COMMA(x) x, |
7 | #else | 8 | #else |
8 | # define __ASM_FORM(x) " " #x " " | 9 | # define __ASM_FORM(x) " " #x " " |
10 | # define __ASM_FORM_RAW(x) #x | ||
9 | # define __ASM_FORM_COMMA(x) " " #x "," | 11 | # define __ASM_FORM_COMMA(x) " " #x "," |
10 | #endif | 12 | #endif |
11 | 13 | ||
12 | #ifdef CONFIG_X86_32 | 14 | #ifdef CONFIG_X86_32 |
13 | # define __ASM_SEL(a,b) __ASM_FORM(a) | 15 | # define __ASM_SEL(a,b) __ASM_FORM(a) |
16 | # define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(a) | ||
14 | #else | 17 | #else |
15 | # define __ASM_SEL(a,b) __ASM_FORM(b) | 18 | # define __ASM_SEL(a,b) __ASM_FORM(b) |
19 | # define __ASM_SEL_RAW(a,b) __ASM_FORM_RAW(b) | ||
16 | #endif | 20 | #endif |
17 | 21 | ||
18 | #define __ASM_SIZE(inst, ...) __ASM_SEL(inst##l##__VA_ARGS__, \ | 22 | #define __ASM_SIZE(inst, ...) __ASM_SEL(inst##l##__VA_ARGS__, \ |
19 | inst##q##__VA_ARGS__) | 23 | inst##q##__VA_ARGS__) |
20 | #define __ASM_REG(reg) __ASM_SEL(e##reg, r##reg) | 24 | #define __ASM_REG(reg) __ASM_SEL_RAW(e##reg, r##reg) |
21 | 25 | ||
22 | #define _ASM_PTR __ASM_SEL(.long, .quad) | 26 | #define _ASM_PTR __ASM_SEL(.long, .quad) |
23 | #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) | 27 | #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) |