Lines Matching refs:idx
66 int idx; in get_free_idx() local
68 for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++) in get_free_idx()
69 if (!t->arch.tls_array[idx].present) in get_free_idx()
70 return idx + GDT_ENTRY_TLS_MIN; in get_free_idx()
92 int idx; in load_TLS() local
94 for (idx = GDT_ENTRY_TLS_MIN; idx < GDT_ENTRY_TLS_MAX; idx++) { in load_TLS()
96 &to->thread.arch.tls_array[idx - GDT_ENTRY_TLS_MIN]; in load_TLS()
105 curr->tls.entry_number = idx; in load_TLS()
201 int idx, int flushed) in set_tls_entry() argument
205 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) in set_tls_entry()
208 t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].tls = *info; in set_tls_entry()
209 t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].present = 1; in set_tls_entry()
210 t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].flushed = flushed; in set_tls_entry()
218 int idx, ret = -EFAULT; in arch_set_tls() local
227 idx = info.entry_number; in arch_set_tls()
229 ret = set_tls_entry(new, &info, idx, 0); in arch_set_tls()
236 int idx) in get_tls_entry() argument
240 if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) in get_tls_entry()
243 if (!t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].present) in get_tls_entry()
246 *info = t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].tls; in get_tls_entry()
254 !t->arch.tls_array[idx - GDT_ENTRY_TLS_MIN].flushed)) { in get_tls_entry()
267 info->entry_number = idx; in get_tls_entry()
274 int idx, ret; in SYSCALL_DEFINE1() local
282 idx = info.entry_number; in SYSCALL_DEFINE1()
284 if (idx == -1) { in SYSCALL_DEFINE1()
285 idx = get_free_idx(current); in SYSCALL_DEFINE1()
286 if (idx < 0) in SYSCALL_DEFINE1()
287 return idx; in SYSCALL_DEFINE1()
288 info.entry_number = idx; in SYSCALL_DEFINE1()
290 if (put_user(idx, &user_desc->entry_number)) in SYSCALL_DEFINE1()
297 return set_tls_entry(current, &info, idx, 1); in SYSCALL_DEFINE1()
305 int ptrace_set_thread_area(struct task_struct *child, int idx, in ptrace_set_thread_area() argument
316 return set_tls_entry(child, &info, idx, 0); in ptrace_set_thread_area()
322 int idx, ret; in SYSCALL_DEFINE1() local
327 if (get_user(idx, &user_desc->entry_number)) in SYSCALL_DEFINE1()
330 ret = get_tls_entry(current, &info, idx); in SYSCALL_DEFINE1()
344 int ptrace_get_thread_area(struct task_struct *child, int idx, in ptrace_get_thread_area() argument
353 ret = get_tls_entry(child, &info, idx); in ptrace_get_thread_area()