forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/x86/um/tls_32.c
....@@ -65,9 +65,6 @@
6565 struct thread_struct *t = &task->thread;
6666 int idx;
6767
68
- if (!t->arch.tls_array)
69
- return GDT_ENTRY_TLS_MIN;
70
-
7168 for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++)
7269 if (!t->arch.tls_array[idx].present)
7370 return idx + GDT_ENTRY_TLS_MIN;
....@@ -215,14 +212,12 @@
215212 return 0;
216213 }
217214
218
-int arch_copy_tls(struct task_struct *new)
215
+int arch_set_tls(struct task_struct *new, unsigned long tls)
219216 {
220217 struct user_desc info;
221218 int idx, ret = -EFAULT;
222219
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)))
226221 goto out;
227222
228223 ret = -EINVAL;
....@@ -241,9 +236,6 @@
241236 int idx)
242237 {
243238 struct thread_struct *t = &task->thread;
244
-
245
- if (!t->arch.tls_array)
246
- goto clear;
247239
248240 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
249241 return -EINVAL;