Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Save the fpu, extended register state to the user signal frame.* 'buf_fx' is the 64-byte aligned pointer at which the [f|fx|x]save* state is copied.* 'buf' points to the 'buf_fx' or to the fsave header followed by 'buf_fx'.

Proto:int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size)

Type:int

Parameter:

TypeParameterName
void __user *buf
void __user *buf_fx
intsize
166  tsk = current process
167  ia32_fxstate = buf != buf_fx
170  ia32_fxstate &= IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_X86_32) || IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_IA32_EMULATION)
173  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(buf, size) Then Return -EACCES
176  If Not static_cpu_has(Onboard FPU ) Then Return If fpregs_soft_get(current process, NULL, 0, sizeof(structuser_i387_ia32_struct), NULL, (struct_fpstate_32__user * )buf) Then -1 Else 1
181  retry :
188  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.
189  If test_thread_flag(load FPU on return to userspace ) Then Internal helper, do not use directly. Use switch_fpu_return() instead.
192  These routines enable/disable the pagefault handler. If disabled, it will* not take any locks and go straight to the fixup table.* User access methods will not sleep when called from a pagefault_disabled()* environment.
193  ret = copy_fpregs_to_sigframe(buf_fx)
194  pagefault_enable()
195  fpregs_unlock()
197  If ret Then
198  If Not Fault everything in given userspace address range in. Then Go to retry
200  Return -EFAULT
204  If (ia32_fxstate || Not use_fxsr() ) && Signal frame handlers. Then Return -1
207  If use_fxsr() && save_xstate_epilog(buf_fx, ia32_fxstate) Then Return -1
210  Return 0
Caller
NameDescribe
get_sigframe