]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: modify get_desc_base
authorGlauber de Oliveira Costa <gcosta@redhat.com>
Wed, 30 Jan 2008 12:31:14 +0000 (13:31 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:31:14 +0000 (13:31 +0100)
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 <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/tls.c
arch/x86/mm/fault_32.c
include/asm-x86/desc.h
include/asm-x86/desc_32.h
include/asm-x86/desc_64.h

index 74d2b65a82eb8e975e83e73f6ee86220bdaa7e78..98f428be8e8cbf15ac937bcf1cc1c4b9eedd5dcf 100644 (file)
@@ -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);
index 6056c6d718355b31b6cd4be88ec15c94ea8abd28..ef5ab2b925c42c4c5c0d9ba8f5d456cb718422fd 100644 (file)
@@ -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);
index 99c4adc851e2f5d7be35bc7febe890ac6c0d9066..a6fdd7c7b6b2d153afb782fea02513f0d7871579 100644 (file)
@@ -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.
index 01415ad35fdf3ad99efca9745dcc039ee3e02b82..8450c2a99c3a97bc29c14c6136e959540614f5ad 100644 (file)
@@ -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
index 448f96ed973fa77f7352be3a7149240108adf044..a7a6c301c6bc044df9f5ee27dc46aba669d7a79f 100644 (file)
@@ -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