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 | 5af725026fe902bf81f1b90b1b9d9ee4b9e1eb6a (patch) | |
tree | 1c413a4e6e24fabc8fb0e09f8050673212e0c8e1 | |
parent | 25deca53e9b74a899efd3ae1f4493f4f2ce36846 (diff) |
x86: modify write_ldt function
This patch modifies the write_ldt() function to make use
of the new struct desc_struct instead of entry_1 and entry_2
entries
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>
-rw-r--r-- | arch/x86/kernel/ldt.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index a8cdca3615bf..7eb0c8a45734 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c | |||
@@ -186,7 +186,7 @@ static int read_default_ldt(void __user *ptr, unsigned long bytecount) | |||
186 | static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | 186 | static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) |
187 | { | 187 | { |
188 | struct mm_struct *mm = current->mm; | 188 | struct mm_struct *mm = current->mm; |
189 | __u32 entry_1, entry_2; | 189 | struct desc_struct ldt; |
190 | int error; | 190 | int error; |
191 | struct user_desc ldt_info; | 191 | struct user_desc ldt_info; |
192 | 192 | ||
@@ -218,21 +218,20 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | |||
218 | /* Allow LDTs to be cleared by the user. */ | 218 | /* Allow LDTs to be cleared by the user. */ |
219 | if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { | 219 | if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { |
220 | if (oldmode || LDT_empty(&ldt_info)) { | 220 | if (oldmode || LDT_empty(&ldt_info)) { |
221 | entry_1 = 0; | 221 | memset(&ldt, 0, sizeof(ldt)); |
222 | entry_2 = 0; | ||
223 | goto install; | 222 | goto install; |
224 | } | 223 | } |
225 | } | 224 | } |
226 | 225 | ||
227 | entry_1 = LDT_entry_a(&ldt_info); | 226 | ldt.a = LDT_entry_a(&ldt_info); |
228 | entry_2 = LDT_entry_b(&ldt_info); | 227 | ldt.b = LDT_entry_b(&ldt_info); |
229 | if (oldmode) | 228 | if (oldmode) |
230 | entry_2 &= ~(1 << 20); | 229 | ldt.avl = 0; |
231 | 230 | ||
232 | /* Install the new entry ... */ | 231 | /* Install the new entry ... */ |
233 | install: | 232 | install: |
234 | write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, | 233 | write_ldt_entry(mm->context.ldt, ldt_info.entry_number, |
235 | entry_2); | 234 | ldt.a, ldt.b); |
236 | error = 0; | 235 | error = 0; |
237 | 236 | ||
238 | out_unlock: | 237 | out_unlock: |