Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eab0c72aecd7982b2c848f7d493ba379efcef15e
Commit:     eab0c72aecd7982b2c848f7d493ba379efcef15e
Parent:     692174b97d5b871f4b0f648b1fb17aa37b955876
Author:     Rusty Russell <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 19:27:09 2007 +0200
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Wed May 2 19:27:09 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Cc: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
 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 7726e74..ac991b5 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)
        (info)->useable         == 0    && \
        (info)->lm              == 0)
 
-#if TLS_SIZE != 24
-# error update this code.
-#endif
-
 static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
 {
+       unsigned int i;
        u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN);
-       gdt[0] = t->tls_array[0];
-       gdt[1] = t->tls_array[1];
-       gdt[2] = t->tls_array[2];
+
+       for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++)
+               gdt[i] = t->tls_array[i];
 } 
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to