函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_get_thread_area

函数原型:int do_get_thread_area(struct task_struct *p, int idx, struct user_desc __user *u_info)

返回类型:int

参数:

类型参数名称
struct task_struct *p
intidx
struct user_desc __user *u_info
226  如果idx恒等于负1且Careful: we have to cast the result to the type of the pointer* for sign reasons(idx, & entry_number)则返回:负EFAULT
229  如果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 ]* idx大于GDT_ENTRY_TLS_MAX则返回:负EINVAL
232  index等于idxThe 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 ]*
233  index等于array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (index, GDT_ENTRY_TLS_MAX - 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 ]* + 1)
236  Get the current Thread-Local Storage area:
238  如果copy_to_user(u_info, & info, info的长度)则返回:负EFAULT
240  返回:0
调用者
名称描述
arch_ptrace