linux/arch/x86/kernel/tls.c

// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/user.h>
#include <linux/regset.h>
#include <linux/syscalls.h>
#include <linux/nospec.h>

#include <linux/uaccess.h>
#include <asm/desc.h>
#include <asm/ldt.h>
#include <asm/processor.h>
#include <asm/proto.h>
#include <asm/gsseg.h>

#include "tls.h"

/*
 * sys_alloc_thread_area: get a yet unused TLS descriptor index.
 */
static int get_free_idx(void)
{}

static bool tls_desc_okay(const struct user_desc *info)
{}

static void set_tls_desc(struct task_struct *p, int idx,
			 const struct user_desc *info, int n)
{}

/*
 * Set a given TLS descriptor:
 */
int do_set_thread_area(struct task_struct *p, int idx,
		       struct user_desc __user *u_info,
		       int can_allocate)
{}

SYSCALL_DEFINE1(set_thread_area, struct user_desc __user *, u_info)
{}


/*
 * Get the current Thread-Local Storage area:
 */

static void fill_user_desc(struct user_desc *info, int idx,
			   const struct desc_struct *desc)

{}

int do_get_thread_area(struct task_struct *p, int idx,
		       struct user_desc __user *u_info)
{}

SYSCALL_DEFINE1(get_thread_area, struct user_desc __user *, u_info)
{}

int regset_tls_active(struct task_struct *target,
		      const struct user_regset *regset)
{}

int regset_tls_get(struct task_struct *target, const struct user_regset *regset,
		   struct membuf to)
{}

int regset_tls_set(struct task_struct *target, const struct user_regset *regset,
		   unsigned int pos, unsigned int count,
		   const void *kbuf, const void __user *ubuf)
{}