aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/tls.c2
-rw-r--r--arch/x86/mm/fault_32.c2
-rw-r--r--include/asm-x86/desc.h5
-rw-r--r--include/asm-x86/desc_32.h8
-rw-r--r--include/asm-x86/desc_64.h9
5 files changed, 7 insertions, 19 deletions
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
index 74d2b65a82eb..98f428be8e8c 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,
112 112
113 memset(&info, 0, sizeof(struct user_desc)); 113 memset(&info, 0, sizeof(struct user_desc));
114 info.entry_number = idx; 114 info.entry_number = idx;
115 info.base_addr = get_desc_base((void *)desc); 115 info.base_addr = get_desc_base((struct desc_struct *)desc);
116 info.limit = GET_LIMIT(desc); 116 info.limit = GET_LIMIT(desc);
117 info.seg_32bit = GET_32BIT(desc); 117 info.seg_32bit = GET_32BIT(desc);
118 info.contents = GET_CONTENTS(desc); 118 info.contents = GET_CONTENTS(desc);
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c
index 6056c6d71835..ef5ab2b925c4 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,
115 } 115 }
116 116
117 /* Decode the code segment base from the descriptor */ 117 /* Decode the code segment base from the descriptor */
118 base = get_desc_base((unsigned long *)desc); 118 base = get_desc_base((struct desc_struct *)desc);
119 119
120 if (seg & (1<<2)) { 120 if (seg & (1<<2)) {
121 mutex_unlock(&current->mm->context.lock); 121 mutex_unlock(&current->mm->context.lock);
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 99c4adc851e2..a6fdd7c7b6b2 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)
69 preempt_enable(); 69 preempt_enable();
70} 70}
71 71
72static inline unsigned long get_desc_base(struct desc_struct *desc)
73{
74 return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
75}
76
72#else 77#else
73/* 78/*
74 * GET_DESC_BASE reads the descriptor base of the specified segment. 79 * 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 01415ad35fdf..8450c2a99c3a 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
168 168
169#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr) 169#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
170 170
171static inline unsigned long get_desc_base(unsigned long *desc)
172{
173 unsigned long base;
174 base = ((desc[0] >> 16) & 0x0000ffff) |
175 ((desc[1] << 16) & 0x00ff0000) |
176 (desc[1] & 0xff000000);
177 return base;
178}
179#endif /* !__ASSEMBLY__ */ 171#endif /* !__ASSEMBLY__ */
180 172
181#endif 173#endif
diff --git a/include/asm-x86/desc_64.h b/include/asm-x86/desc_64.h
index 448f96ed973f..a7a6c301c6bc 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)
156 gdt[i] = t->tls_array[i]; 156 gdt[i] = t->tls_array[i];
157} 157}
158 158
159static inline unsigned long get_desc_base(const void *ptr)
160{
161 const u32 *desc = ptr;
162 unsigned long base;
163 base = ((desc[0] >> 16) & 0x0000ffff) |
164 ((desc[1] << 16) & 0x00ff0000) |
165 (desc[1] & 0xff000000);
166 return base;
167}
168#endif /* !__ASSEMBLY__ */ 159#endif /* !__ASSEMBLY__ */
169 160
170#endif 161#endif