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:08
Last Modify:2022-05-18 16:59:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:set_tls_desc

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

Type:void

Parameter:

TypeParameterName
struct task_struct *p
intidx
const struct user_desc *info
intn
87  t = * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct.
88  desc = Cached TLS descriptors: [idx - 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 ]* ]
94  cpu = get_cpu()
96  When n-- > 0 cycle
97  If This intentionally ignores lm, since 32-bit apps don't have that field. (info) || Lots of programs expect an all-zero user_desc to mean "no segment at all". Then memset(desc, 0, size of desc )
99  Else fill_ldt(desc, info)
101  ++info
102  ++desc
105  If t == thread Then load_TLS(t, cpu)
108  put_cpu()
Caller
NameDescribe
do_set_thread_areaSet a given TLS descriptor:
regset_tls_set