aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/system.h
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-11-25 14:18:26 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-26 04:33:58 -0500
commit79b0379cee09b00ef309384aff652e328e438c79 (patch)
tree5a87d096d1f05b47f8372eda2523b1e1c830be23 /arch/x86/include/asm/system.h
parent3c93ca00eeeb774c7dd666cc7286a9e90c53e998 (diff)
x86: Optimize loadsegment()
Zero the input register in the exception handler instead of using an extra register to pass in a zero value. Signed-off-by: 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.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index 1a953e26401c..537395a2877a 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -156,18 +156,19 @@ extern void native_load_gs_index(unsigned);
156 * segment if something goes wrong.. 156 * segment if something goes wrong..
157 */ 157 */
158#define loadsegment(seg, value) \ 158#define loadsegment(seg, value) \
159do { \
160 unsigned short __val = value; \
159 asm volatile("\n" \ 161 asm volatile("\n" \
160 "1:\t" \ 162 "1:\t" \
161 "movl %k0,%%" #seg "\n" \ 163 "movl %k0,%%" #seg "\n" \
162 "2:\n" \
163 ".section .fixup,\"ax\"\n" \ 164 ".section .fixup,\"ax\"\n" \
164 "3:\t" \ 165 "2:\t" \
165 "movl %k1, %%" #seg "\n\t" \ 166 "xorl %k0,%k0\n\t" \
166 "jmp 2b\n" \ 167 "jmp 1b\n" \
167 ".previous\n" \ 168 ".previous\n" \
168 _ASM_EXTABLE(1b,3b) \ 169 _ASM_EXTABLE(1b, 2b) \
169 : :"r" (value), "r" (0) : "memory") 170 : "+r" (__val) : : "memory"); \
170 171} while (0)
171 172
172/* 173/*
173 * Save a segment register away 174 * Save a segment register away