diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:13 -0500 |
commit | 80fbb69a8d1268ef48dfe21da80e68cb01922f31 (patch) | |
tree | 6cc2d5d0fdc40eb53f74e36c5557fa24f89edce0 /arch/x86/kernel | |
parent | 5af725026fe902bf81f1b90b1b9d9ee4b9e1eb6a (diff) |
x86: introduce fill_ldt
This patch introduces fill_ldt(), which populates a ldt descriptor
from a user_desc in once, instead of relying in the LDT_entry_a and
LDT_entry_b macros
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 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/ldt.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/process_64.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/tls.c | 7 |
3 files changed, 5 insertions, 8 deletions
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 7eb0c8a45734..3e872b468533 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c | |||
@@ -223,8 +223,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | |||
223 | } | 223 | } |
224 | } | 224 | } |
225 | 225 | ||
226 | ldt.a = LDT_entry_a(&ldt_info); | 226 | fill_ldt(&ldt, &ldt_info); |
227 | ldt.b = LDT_entry_b(&ldt_info); | ||
228 | if (oldmode) | 227 | if (oldmode) |
229 | ldt.avl = 0; | 228 | ldt.avl = 0; |
230 | 229 | ||
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 86c310acc989..f91521e26335 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -457,8 +457,7 @@ static inline void set_32bit_tls(struct task_struct *t, int tls, u32 addr) | |||
457 | }; | 457 | }; |
458 | struct desc_struct *desc = (void *)t->thread.tls_array; | 458 | struct desc_struct *desc = (void *)t->thread.tls_array; |
459 | desc += tls; | 459 | desc += tls; |
460 | desc->a = LDT_entry_a(&ud); | 460 | fill_ldt(desc, &ud); |
461 | desc->b = LDT_entry_b(&ud); | ||
462 | } | 461 | } |
463 | 462 | ||
464 | static inline u32 read_32bit_tls(struct task_struct *t, int tls) | 463 | static inline u32 read_32bit_tls(struct task_struct *t, int tls) |
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c index 67a377621b12..74d2b65a82eb 100644 --- a/arch/x86/kernel/tls.c +++ b/arch/x86/kernel/tls.c | |||
@@ -67,10 +67,9 @@ int do_set_thread_area(struct task_struct *p, int idx, | |||
67 | if (LDT_empty(&info)) { | 67 | if (LDT_empty(&info)) { |
68 | desc[0] = 0; | 68 | desc[0] = 0; |
69 | desc[1] = 0; | 69 | desc[1] = 0; |
70 | } else { | 70 | } else |
71 | desc[0] = LDT_entry_a(&info); | 71 | fill_ldt((struct desc_struct *)desc, &info); |
72 | desc[1] = LDT_entry_b(&info); | 72 | |
73 | } | ||
74 | if (t == ¤t->thread) | 73 | if (t == ¤t->thread) |
75 | load_TLS(t, cpu); | 74 | load_TLS(t, cpu); |
76 | 75 | ||