Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\fpu\core.c Create Date:2022-07-28 07:49:27
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:fpu__copy

Proto:int fpu__copy(struct task_struct *dst, struct task_struct *src)

Type:int

Parameter:

TypeParameterName
struct task_struct *dst
struct task_struct *src
169  dst_fpu = Floating point and extended processor state
170  src_fpu = Floating point and extended processor state
172  @last_cpu:* Records the last CPU on which this context was loaded into* FPU registers = -1
174  If Not static_cpu_has(Onboard FPU ) Then Return 0
177  WARN_ON_FPU(src_fpu != & fpu)
183  memset( & xsave, 0, Size of the FPU context state. All tasks in the system use the* same context size, regardless of what portion they use.* This is inherent to the XSAVE architecture which puts all state* components into a single, continuous memory block:)
193  Use fpregs_lock() while editing CPU's FPU registers or fpu->state.* A context switch will (and softirq might) save CPU's FPU registers to* fpu->state and set TIF_NEED_FPU_LOAD leaving CPU's FPU registers in* a random state.
194  If test_thread_flag(load FPU on return to userspace ) Then memcpy( & @state:* In-memory copy of all FPU registers that we save/restore* over context switches. If the task is using the FPU then* the registers in the FPU are more recent than this state* copy. If the task context-switches away then they get, & @state:* In-memory copy of all FPU registers that we save/restore* over context switches. If the task is using the FPU then* the registers in the FPU are more recent than this state* copy. If the task context-switches away then they get, Size of the FPU context state. All tasks in the system use the* same context size, regardless of what portion they use.* This is inherent to the XSAVE architecture which puts all state* components into a single, continuous memory block:)
197  Else if Not These must be called with preempt disabled Then copy_kernel_to_fpregs( & @state:* In-memory copy of all FPU registers that we save/restore* over context switches. If the task is using the FPU then* the registers in the FPU are more recent than this state* copy. If the task context-switches away then they get)
200  fpregs_unlock()
202  Set thread flags in other task's structures.* See asm/thread_info.h for TIF_xxxx flags available:
204  trace_x86_fpu_copy_src(src_fpu)
205  trace_x86_fpu_copy_dst(dst_fpu)
207  Return 0
Caller
NameDescribe
arch_dup_task_structhis gets called so that we can store lazy state into memory and copy the* current task into the new thread.