Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\tls.c Create Date:2022-07-28 07:52:15
Last Modify:2022-05-18 16:59:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:regset_tls_set

Proto: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)

Type:int

Parameter:

TypeParameterName
struct task_struct *target
const struct user_regset *regset
unsigned intpos
unsigned intcount
const void *kbuf
const void __user *ubuf
300  If pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(structuser_desc) || pos % sizeof(structuser_desc) != 0 || count % sizeof(structuser_desc) != 0 Then Return -EINVAL
305  If kbuf Then info = kbuf
307  Else if __copy_from_user(infobuf, ubuf, count) Then Return -EFAULT
309  Else info = infobuf
312  When i < count / sizeof(structuser_desc) cycle If Not tls_desc_okay(info + i) Then
314  Return -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  Return 0