Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\process.c Create Date:2022-07-28 07:48:39
Last Modify:2020-03-16 17:03:44 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:copy_thread_tls

Proto:int copy_thread_tls(unsigned long clone_flags, unsigned long sp, unsigned long arg, struct task_struct *p, unsigned long tls)

Type:int

Parameter:

TypeParameterName
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, size of Save middle states of ptrace breakpoints )
144  Save a segment register away:(gs, gsindex)
145  gsbase = If gsindex Then 0 Else gsbase
146  Save a segment register away:(fs, fsindex)
147  fsbase = If fsindex Then 0 Else fsbase
148  Save a segment register away:(es, es)
149  Save a segment register away:(These functions are used to reference data in other segments. , ds)
162  If Value for the false possibility is greater at compile time( Per task flags (PF_*), defined further below: & I am a kernel thread ) Then
163  memset(childregs, 0, sizeof(structpt_regs))
164  kthread_frame_init(frame, sp, arg)
165  Return 0
168  bx = 0
169  childregs = current_pt_regs()
170  ax = 0
171  If sp Then sp = sp
175  task_user_gs(p) = x86-32 user GS accessors:(current_pt_regs())
179  If clone_flags & create a new TLS for the child Then ret = set_new_tls(p, tls)
182  If Not ret && Value for the false possibility is greater at compile time(test_tsk_thread_flag(current process, uses I/O bitmap )) Then io_bitmap_share(p)
185  Return ret