1 #include <linux/kernel.h>
2 #include <linux/errno.h>
3 #include <linux/sched.h>
7 #include <asm/uaccess.h>
10 #include <asm/processor.h>
12 #include <asm/syscalls.h>
19 static int get_free_idx(
void)
44 desc->
a = desc->
b = 0;
76 if (idx == -1 && can_allocate) {
80 if (
put_user(idx, &u_info->entry_number))
87 set_tls_desc(p, idx, &info, 1);
104 static void fill_user_desc(
struct user_desc *info,
int idx,
108 memset(info, 0,
sizeof(*info));
111 info->
limit = get_desc_limit(desc);
128 if (idx == -1 &&
get_user(idx, &u_info->entry_number))
134 fill_user_desc(&info, idx,
160 unsigned int pos,
unsigned int count,
161 void *kbuf,
void __user *ubuf)
165 if (pos >= GDT_ENTRY_TLS_ENTRIES *
sizeof(
struct user_desc) ||
182 while (count-- > 0) {
194 unsigned int pos,
unsigned int count,
195 const void *kbuf,
const void __user *ubuf)
197 struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES];
200 if (pos >= GDT_ENTRY_TLS_ENTRIES *
sizeof(
struct user_desc) ||