函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\process.c Create Date:2022-07-27 08:48:40
Last Modify:2020-03-16 17:03:44 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:copy_thread_tls

函数原型:int copy_thread_tls(unsigned long clone_flags, unsigned long sp, unsigned long arg, struct task_struct *p, unsigned long tls)

返回类型:int

参数:

类型参数名称
unsigned longclone_flags
unsigned longsp
unsigned longarg
struct task_struct *p
unsigned longtls
131  ret等于0
133  childregs等于task_pt_regs(p)
134  fork_frame等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(childregs, structfork_frame, regs)
135  frame等于frame
137  These two fields must be together. They form a stack frame header,* needed by get_frame_pointer().等于0
138  ret_addr等于ret_from_fork
139  sp等于fork_frame
140  IO permissions: = NULL
141  memset( Save middle states of ptrace breakpoints , 0, Save middle states of ptrace breakpoints 的长度)
144  Save a segment register away:(取寄存器值(gs), gsindex)
145  gsbase等于如果gsindex则0否则gsbase
146  Save a segment register away:(取寄存器值(fs), fsindex)
147  fsbase等于如果fsindex则0否则fsbase
148  Save a segment register away:(es, es)
149  Save a segment register away:(取寄存器值(ds), ds)
162  如果此条件成立可能性小(为编译器优化)(任务标志 & I am a kernel thread )则
163  memset(childregs, 0, sizeof(structpt_regs))
164  kthread_frame_init(frame, sp, arg)
165  返回:0
168  bx等于0
169  childregs等于current_pt_regs()
170  ax等于0
171  如果spsp等于sp
175  task_user_gs(p)等于x86-32 user GS accessors:(current_pt_regs())
179  如果clone_flags按位与独立的TLSret等于set_new_tls(p, tls)
182  如果非ret此条件成立可能性小(为编译器优化)(test_tsk_thread_flag(当前进程, uses I/O bitmap ))则io_bitmap_share(p)
185  返回:ret