| .. | .. |
|---|
| 65 | 65 | struct thread_struct *t = &task->thread; |
|---|
| 66 | 66 | int idx; |
|---|
| 67 | 67 | |
|---|
| 68 | | - if (!t->arch.tls_array) |
|---|
| 69 | | - return GDT_ENTRY_TLS_MIN; |
|---|
| 70 | | - |
|---|
| 71 | 68 | for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++) |
|---|
| 72 | 69 | if (!t->arch.tls_array[idx].present) |
|---|
| 73 | 70 | return idx + GDT_ENTRY_TLS_MIN; |
|---|
| .. | .. |
|---|
| 215 | 212 | return 0; |
|---|
| 216 | 213 | } |
|---|
| 217 | 214 | |
|---|
| 218 | | -int arch_copy_tls(struct task_struct *new) |
|---|
| 215 | +int arch_set_tls(struct task_struct *new, unsigned long tls) |
|---|
| 219 | 216 | { |
|---|
| 220 | 217 | struct user_desc info; |
|---|
| 221 | 218 | int idx, ret = -EFAULT; |
|---|
| 222 | 219 | |
|---|
| 223 | | - if (copy_from_user(&info, |
|---|
| 224 | | - (void __user *) UPT_SI(&new->thread.regs.regs), |
|---|
| 225 | | - sizeof(info))) |
|---|
| 220 | + if (copy_from_user(&info, (void __user *) tls, sizeof(info))) |
|---|
| 226 | 221 | goto out; |
|---|
| 227 | 222 | |
|---|
| 228 | 223 | ret = -EINVAL; |
|---|
| .. | .. |
|---|
| 241 | 236 | int idx) |
|---|
| 242 | 237 | { |
|---|
| 243 | 238 | struct thread_struct *t = &task->thread; |
|---|
| 244 | | - |
|---|
| 245 | | - if (!t->arch.tls_array) |
|---|
| 246 | | - goto clear; |
|---|
| 247 | 239 | |
|---|
| 248 | 240 | if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) |
|---|
| 249 | 241 | return -EINVAL; |
|---|