Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc6978528cbd475d952e0eb5073375839dfb600e
Commit:     cc6978528cbd475d952e0eb5073375839dfb600e
Parent:     26048d75e8d6c840742468667f4a7ab8c2df74c9
Author:     Glauber de Oliveira Costa <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:31:14 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:31:14 2008 +0100

    x86: modify get_desc_base
    
    This patch makes get_desc_base() receive a struct desc_struct,
    and then uses its internal fields to compute the base address.
    This is done at both i386 and x86_64, and then it is moved
    to common header
    
    Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/tls.c     |    2 +-
 arch/x86/mm/fault_32.c    |    2 +-
 include/asm-x86/desc.h    |    5 +++++
 include/asm-x86/desc_32.h |    8 --------
 include/asm-x86/desc_64.h |    9 ---------
 5 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
index 74d2b65..98f428b 100644
--- a/arch/x86/kernel/tls.c
+++ b/arch/x86/kernel/tls.c
@@ -112,7 +112,7 @@ int do_get_thread_area(struct task_struct *p, int idx,
 
        memset(&info, 0, sizeof(struct user_desc));
        info.entry_number = idx;
-       info.base_addr = get_desc_base((void *)desc);
+       info.base_addr = get_desc_base((struct desc_struct *)desc);
        info.limit = GET_LIMIT(desc);
        info.seg_32bit = GET_32BIT(desc);
        info.contents = GET_CONTENTS(desc);
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c
index 6056c6d..ef5ab2b 100644
--- a/arch/x86/mm/fault_32.c
+++ b/arch/x86/mm/fault_32.c
@@ -115,7 +115,7 @@ static inline unsigned long get_segment_eip(struct pt_regs 
*regs,
        }
 
        /* Decode the code segment base from the descriptor */
-       base = get_desc_base((unsigned long *)desc);
+       base = get_desc_base((struct desc_struct *)desc);
 
        if (seg & (1<<2)) { 
                mutex_unlock(&current->mm->context.lock);
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 99c4adc..a6fdd7c 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -69,6 +69,11 @@ static inline void load_LDT(mm_context_t *pc)
        preempt_enable();
 }
 
+static inline unsigned long get_desc_base(struct desc_struct *desc)
+{
+       return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
+}
+
 #else
 /*
  * GET_DESC_BASE reads the descriptor base of the specified segment.
diff --git a/include/asm-x86/desc_32.h b/include/asm-x86/desc_32.h
index 01415ad..8450c2a 100644
--- a/include/asm-x86/desc_32.h
+++ b/include/asm-x86/desc_32.h
@@ -168,14 +168,6 @@ static inline void __set_tss_desc(unsigned int cpu, 
unsigned int entry, const vo
 
 #define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
 
-static inline unsigned long get_desc_base(unsigned long *desc)
-{
-       unsigned long base;
-       base = ((desc[0] >> 16)  & 0x0000ffff) |
-               ((desc[1] << 16) & 0x00ff0000) |
-               (desc[1] & 0xff000000);
-       return base;
-}
 #endif /* !__ASSEMBLY__ */
 
 #endif
diff --git a/include/asm-x86/desc_64.h b/include/asm-x86/desc_64.h
index 448f96e..a7a6c30 100644
--- a/include/asm-x86/desc_64.h
+++ b/include/asm-x86/desc_64.h
@@ -156,15 +156,6 @@ static inline void load_TLS(struct thread_struct *t, 
unsigned int cpu)
                gdt[i] = t->tls_array[i];
 }
 
-static inline unsigned long get_desc_base(const void *ptr)
-{
-       const u32 *desc = ptr;
-       unsigned long base;
-       base = ((desc[0] >> 16)  & 0x0000ffff) |
-               ((desc[1] << 16) & 0x00ff0000) |
-               (desc[1] & 0xff000000);
-       return base;
-}
 #endif /* !__ASSEMBLY__ */
 
 #endif
-
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