diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-11-26 04:37:55 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-26 04:38:52 -0500 |
commit | 64b028b22616946a05bf9580f7f7f7ee2ac070b4 (patch) | |
tree | 923af35553b0115daa2893e9ac16084bce717cd9 /arch/x86/include/asm/system.h | |
parent | 79b0379cee09b00ef309384aff652e328e438c79 (diff) |
x86: Clean up the loadsegment() macro
Make it readable in the source too, not just in the assembly output.
No change in functionality.
Cc: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <1259176706-5908-1-git-send-email-brgerst@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/system.h')
-rw-r--r-- | arch/x86/include/asm/system.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h index 537395a2877a..022a84386de8 100644 --- a/arch/x86/include/asm/system.h +++ b/arch/x86/include/asm/system.h | |||
@@ -155,19 +155,21 @@ extern void native_load_gs_index(unsigned); | |||
155 | * Load a segment. Fall back on loading the zero | 155 | * Load a segment. Fall back on loading the zero |
156 | * segment if something goes wrong.. | 156 | * segment if something goes wrong.. |
157 | */ | 157 | */ |
158 | #define loadsegment(seg, value) \ | 158 | #define loadsegment(seg, value) \ |
159 | do { \ | 159 | do { \ |
160 | unsigned short __val = value; \ | 160 | unsigned short __val = (value); \ |
161 | asm volatile("\n" \ | 161 | \ |
162 | "1:\t" \ | 162 | asm volatile(" \n" \ |
163 | "movl %k0,%%" #seg "\n" \ | 163 | "1: movl %k0,%%" #seg " \n" \ |
164 | ".section .fixup,\"ax\"\n" \ | 164 | \ |
165 | "2:\t" \ | 165 | ".section .fixup,\"ax\" \n" \ |
166 | "xorl %k0,%k0\n\t" \ | 166 | "2: xorl %k0,%k0 \n" \ |
167 | "jmp 1b\n" \ | 167 | " jmp 1b \n" \ |
168 | ".previous\n" \ | 168 | ".previous \n" \ |
169 | _ASM_EXTABLE(1b, 2b) \ | 169 | \ |
170 | : "+r" (__val) : : "memory"); \ | 170 | _ASM_EXTABLE(1b, 2b) \ |
171 | \ | ||
172 | : "+r" (__val) : : "memory"); \ | ||
171 | } while (0) | 173 | } while (0) |
172 | 174 | ||
173 | /* | 175 | /* |