diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-01-30 07:30:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:13 -0500 |
commit | fc2d625c4fac18e672a3b7c61af5de22d7ab7d87 (patch) | |
tree | a6d450d94181bca5d058f73e9a4a6163058664b6 /arch/x86/kernel/ldt_64.c | |
parent | 4edc8f5454814201d2fb222354284365b4f0537c (diff) |
x86: introduce ldt_write accessor
Create a ldt write accessor like the 32 bit one.
Preparatory patch for merging ldt.c and anyway necessary for
64bit paravirt ops.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/ldt_64.c')
-rw-r--r-- | arch/x86/kernel/ldt_64.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/kernel/ldt_64.c b/arch/x86/kernel/ldt_64.c index 6c41db367de8..d72dc7a0636f 100644 --- a/arch/x86/kernel/ldt_64.c +++ b/arch/x86/kernel/ldt_64.c | |||
@@ -172,7 +172,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | |||
172 | { | 172 | { |
173 | struct task_struct *me = current; | 173 | struct task_struct *me = current; |
174 | struct mm_struct *mm = me->mm; | 174 | struct mm_struct *mm = me->mm; |
175 | __u32 entry_1, entry_2, *lp; | 175 | __u32 entry_1, entry_2; |
176 | int error; | 176 | int error; |
177 | struct user_desc ldt_info; | 177 | struct user_desc ldt_info; |
178 | 178 | ||
@@ -202,8 +202,6 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | |||
202 | goto out_unlock; | 202 | goto out_unlock; |
203 | } | 203 | } |
204 | 204 | ||
205 | lp = (__u32 *)((ldt_info.entry_number << 3) + (char *)mm->context.ldt); | ||
206 | |||
207 | /* Allow LDTs to be cleared by the user. */ | 205 | /* Allow LDTs to be cleared by the user. */ |
208 | if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { | 206 | if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { |
209 | if (oldmode || LDT_empty(&ldt_info)) { | 207 | if (oldmode || LDT_empty(&ldt_info)) { |
@@ -220,8 +218,8 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | |||
220 | 218 | ||
221 | /* Install the new entry ... */ | 219 | /* Install the new entry ... */ |
222 | install: | 220 | install: |
223 | *lp = entry_1; | 221 | write_ldt_entry(mm->context.ldt, ldt_info.entry_number, entry_1, |
224 | *(lp+1) = entry_2; | 222 | entry_2); |
225 | error = 0; | 223 | error = 0; |
226 | 224 | ||
227 | out_unlock: | 225 | out_unlock: |