diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-05-02 13:27:09 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:09 -0400 |
commit | eab0c72aecd7982b2c848f7d493ba379efcef15e (patch) | |
tree | 760b05a1f4446a8a1d316d7534b94b18b8bb1b69 /include/asm-x86_64 | |
parent | 692174b97d5b871f4b0f648b1fb17aa37b955876 (diff) |
[PATCH] x86-64: Introduce load_TLS to the "for" loop.
GCC (4.1 at least) unrolls it anyway, but I can't believe this code
was ever justifiable. (I've also submitted a patch which cleans up
i386, which is even uglier).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/desc.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h index 7726e74db536..ac991b5ca0fd 100644 --- a/include/asm-x86_64/desc.h +++ b/include/asm-x86_64/desc.h | |||
@@ -135,16 +135,13 @@ static inline void set_ldt_desc(unsigned cpu, void *addr, int size) | |||
135 | (info)->useable == 0 && \ | 135 | (info)->useable == 0 && \ |
136 | (info)->lm == 0) | 136 | (info)->lm == 0) |
137 | 137 | ||
138 | #if TLS_SIZE != 24 | ||
139 | # error update this code. | ||
140 | #endif | ||
141 | |||
142 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) | 138 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) |
143 | { | 139 | { |
140 | unsigned int i; | ||
144 | u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN); | 141 | u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN); |
145 | gdt[0] = t->tls_array[0]; | 142 | |
146 | gdt[1] = t->tls_array[1]; | 143 | for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++) |
147 | gdt[2] = t->tls_array[2]; | 144 | gdt[i] = t->tls_array[i]; |
148 | } | 145 | } |
149 | 146 | ||
150 | /* | 147 | /* |