diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:14 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:14 -0500 |
commit | 881c2975d02b6575c417a6eee40868d60a9ecba9 (patch) | |
tree | 402785bef46e3051aca5d006eaddbf0b99aff502 /include/asm-x86/desc_32.h | |
parent | 59fbed775aa5a6f352bfbde6b40508b541086b7e (diff) |
x86: unify non-paravirt parts of desc.h
This patch unifies the non-paravirt part of desc_{32,64}.h into
desc.h. Most of it, is simply common code, that is moved to
the shared header. The only exception is the set_ldt_desc in desc_64.h,
which is changed - included its name - to accomodate for the way
the ldt is set up in i386.
Also, constant definitions used in desc_32.h are moved to desc_defs.h
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>
Diffstat (limited to 'include/asm-x86/desc_32.h')
-rw-r--r-- | include/asm-x86/desc_32.h | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/include/asm-x86/desc_32.h b/include/asm-x86/desc_32.h index 14238df87c7d..01415ad35fdf 100644 --- a/include/asm-x86/desc_32.h +++ b/include/asm-x86/desc_32.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
12 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
13 | 13 | ||
14 | #include <asm/mmu.h> | ||
15 | |||
16 | struct gdt_page | 14 | struct gdt_page |
17 | { | 15 | { |
18 | struct desc_struct gdt[GDT_ENTRIES]; | 16 | struct desc_struct gdt[GDT_ENTRIES]; |
@@ -24,8 +22,6 @@ static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | |||
24 | return per_cpu(gdt_page, cpu).gdt; | 22 | return per_cpu(gdt_page, cpu).gdt; |
25 | } | 23 | } |
26 | 24 | ||
27 | extern struct desc_ptr idt_descr; | ||
28 | extern gate_desc idt_table[]; | ||
29 | extern void set_intr_gate(unsigned int irq, void * addr); | 25 | extern void set_intr_gate(unsigned int irq, void * addr); |
30 | 26 | ||
31 | static inline void pack_descriptor(struct desc_struct *desc, | 27 | static inline void pack_descriptor(struct desc_struct *desc, |
@@ -172,36 +168,6 @@ static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const vo | |||
172 | 168 | ||
173 | #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) |
174 | 170 | ||
175 | #define LDT_empty(info) (\ | ||
176 | (info)->base_addr == 0 && \ | ||
177 | (info)->limit == 0 && \ | ||
178 | (info)->contents == 0 && \ | ||
179 | (info)->read_exec_only == 1 && \ | ||
180 | (info)->seg_32bit == 0 && \ | ||
181 | (info)->limit_in_pages == 0 && \ | ||
182 | (info)->seg_not_present == 1 && \ | ||
183 | (info)->useable == 0 ) | ||
184 | |||
185 | static inline void clear_LDT(void) | ||
186 | { | ||
187 | set_ldt(NULL, 0); | ||
188 | } | ||
189 | |||
190 | /* | ||
191 | * load one particular LDT into the current CPU | ||
192 | */ | ||
193 | static inline void load_LDT_nolock(mm_context_t *pc) | ||
194 | { | ||
195 | set_ldt(pc->ldt, pc->size); | ||
196 | } | ||
197 | |||
198 | static inline void load_LDT(mm_context_t *pc) | ||
199 | { | ||
200 | preempt_disable(); | ||
201 | load_LDT_nolock(pc); | ||
202 | preempt_enable(); | ||
203 | } | ||
204 | |||
205 | static inline unsigned long get_desc_base(unsigned long *desc) | 171 | static inline unsigned long get_desc_base(unsigned long *desc) |
206 | { | 172 | { |
207 | unsigned long base; | 173 | unsigned long base; |
@@ -210,30 +176,6 @@ static inline unsigned long get_desc_base(unsigned long *desc) | |||
210 | (desc[1] & 0xff000000); | 176 | (desc[1] & 0xff000000); |
211 | return base; | 177 | return base; |
212 | } | 178 | } |
213 | |||
214 | #else /* __ASSEMBLY__ */ | ||
215 | |||
216 | /* | ||
217 | * GET_DESC_BASE reads the descriptor base of the specified segment. | ||
218 | * | ||
219 | * Args: | ||
220 | * idx - descriptor index | ||
221 | * gdt - GDT pointer | ||
222 | * base - 32bit register to which the base will be written | ||
223 | * lo_w - lo word of the "base" register | ||
224 | * lo_b - lo byte of the "base" register | ||
225 | * hi_b - hi byte of the low word of the "base" register | ||
226 | * | ||
227 | * Example: | ||
228 | * GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah) | ||
229 | * Will read the base address of GDT_ENTRY_ESPFIX_SS and put it into %eax. | ||
230 | */ | ||
231 | #define GET_DESC_BASE(idx, gdt, base, lo_w, lo_b, hi_b) \ | ||
232 | movb idx*8+4(gdt), lo_b; \ | ||
233 | movb idx*8+7(gdt), hi_b; \ | ||
234 | shll $16, base; \ | ||
235 | movw idx*8+2(gdt), lo_w; | ||
236 | |||
237 | #endif /* !__ASSEMBLY__ */ | 179 | #endif /* !__ASSEMBLY__ */ |
238 | 180 | ||
239 | #endif | 181 | #endif |