函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\tls.c Create Date:2022-07-27 08:52:26
Last Modify:2022-05-18 16:59:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:regset_tls_set

函数原型: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)

返回类型:int

参数:

类型参数名称
struct task_struct *target
const struct user_regset *regset
unsigned intpos
unsigned intcount
const void *kbuf
const void __user *ubuf
300  如果pos大于等于GDT_ENTRY_TLS_ENTRIESsizeof(structuser_desc)或pos取模sizeof(structuser_desc)不等于0或count取模sizeof(structuser_desc)不等于0则返回:负EINVAL
305  如果kbufinfo等于kbuf
307  否则如果__copy_from_user(infobuf, ubuf, count)则返回:负EFAULT
309  否则info等于infobuf
312 i小于countsizeof(structuser_desc)循环如果非tls_desc_okay(info + i)则
314  返回:负EINVAL
316  set_tls_desc(target, The layout of the per-CPU GDT under Linux:* 0 - null <=== cacheline #1* 1 - reserved* 2 - reserved* 3 - reserved* 4 - unused <=== cacheline #2* 5 - unused* ------- start of TLS (Thread-Local Storage) segments:* 6 - TLS segment #1 [ glibc's TLS segment ]* + (pos / sizeof(structuser_desc)), info, count / sizeof(structuser_desc))
320  返回:0