函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:set_tls_desc

函数原型:static void set_tls_desc(struct task_struct *p, int idx, const struct user_desc *info, int n)

返回类型:void

参数:

类型参数名称
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 n自减大于0循环
97  如果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". memset(desc, 0, desc的长度)
99  否则fill_ldt(desc, info)
101  info先自加
102  desc先自加
105  如果t恒等于threadload_TLS(t, cpu)
108  put_cpu()
调用者
名称描述
do_set_thread_areaSet a given TLS descriptor:
regset_tls_set