diff options
author | Roland McGrath <roland@redhat.com> | 2008-01-30 07:31:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:51 -0500 |
commit | 1bd5718ce58fb49ac158653380fa200f4759daad (patch) | |
tree | 51769d5394214fe0bb6affeb9b9ae33c447ffa73 /include/asm-x86/desc.h | |
parent | 1eeaed7679eab3666d2d8c964d060c2169b3813b (diff) |
x86: x86 TLS desc_struct cleanup
This cleans up the TLS code to use struct desc_struct and to separate the
encoding and installation magic from the interface wrappers.
Signed-off-by: Roland McGrath <roland@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.h')
-rw-r--r-- | include/asm-x86/desc.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h index e17581ad8824..5b6a05d3a771 100644 --- a/include/asm-x86/desc.h +++ b/include/asm-x86/desc.h | |||
@@ -7,7 +7,8 @@ | |||
7 | #include <asm/mmu.h> | 7 | #include <asm/mmu.h> |
8 | #include <linux/smp.h> | 8 | #include <linux/smp.h> |
9 | 9 | ||
10 | static inline void fill_ldt(struct desc_struct *desc, struct user_desc *info) | 10 | static inline void fill_ldt(struct desc_struct *desc, |
11 | const struct user_desc *info) | ||
11 | { | 12 | { |
12 | desc->limit0 = info->limit & 0x0ffff; | 13 | desc->limit0 = info->limit & 0x0ffff; |
13 | desc->base0 = info->base_addr & 0x0000ffff; | 14 | desc->base0 = info->base_addr & 0x0000ffff; |
@@ -275,10 +276,16 @@ static inline void load_LDT(mm_context_t *pc) | |||
275 | preempt_enable(); | 276 | preempt_enable(); |
276 | } | 277 | } |
277 | 278 | ||
278 | static inline unsigned long get_desc_base(struct desc_struct *desc) | 279 | static inline unsigned long get_desc_base(const struct desc_struct *desc) |
279 | { | 280 | { |
280 | return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24); | 281 | return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24); |
281 | } | 282 | } |
283 | |||
284 | static inline unsigned long get_desc_limit(const struct desc_struct *desc) | ||
285 | { | ||
286 | return desc->limit0 | (desc->limit << 16); | ||
287 | } | ||
288 | |||
282 | static inline void _set_gate(int gate, unsigned type, void *addr, | 289 | static inline void _set_gate(int gate, unsigned type, void *addr, |
283 | unsigned dpl, unsigned ist, unsigned seg) | 290 | unsigned dpl, unsigned ist, unsigned seg) |
284 | { | 291 | { |