Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kcov_ioctl

Proto:static long kcov_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)

Type:long

Parameter:

TypeParameterName
struct file *filep
unsigned intcmd
unsigned longarg
677  struct kcov_remote_arg * remote_arg = NULL
681  If cmd == KCOV_REMOTE_ENABLE Then
682  If Get a simple variable from user space(remote_num_handles, (unsigned__user * )(arg + offsetof(structkcov_remote_arg, num_handles))) Then Return -EFAULT
685  If remote_num_handles > KCOV_REMOTE_MAX_HANDLES Then Return -EINVAL
687  remote_arg_size = struct_size() - Calculate size of structure with trailing array.*@p: Pointer to the structure.*@member: Name of the array member.*@n: Number of elements in the array.* Calculates size of memory needed for structure @p followed by an(remote_arg, handles, remote_num_handles)
689  remote_arg = memdup_user((void__user * )arg, remote_arg_size)
690  If IS_ERR(remote_arg) Then Return PTR_ERR(remote_arg)
693  kfree(remote_arg)
694  Return -EINVAL
696  arg = remote_arg
699  kcov = needed for tty driver, and maybe others
700  spin_lock( & The lock protects mode, size, area and t. )
701  res = kcov_ioctl_locked(kcov, cmd, arg)
702  spin_unlock( & The lock protects mode, size, area and t. )
704  kfree(remote_arg)
706  Return res