函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kcov.c Create Date:2022-07-27 12:37:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kcov_ioctl

函数原型:static long kcov_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)

返回类型:long

参数:

类型参数名称
struct file *filep
unsigned intcmd
unsigned longarg
677  struct kcov_remote_arg * remote_arg = NULL
681  如果cmd恒等于KCOV_REMOTE_ENABLE
682  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(remote_num_handles, (unsigned__user * )(arg + offsetof(structkcov_remote_arg, num_handles)))则返回:负EFAULT
685  如果remote_num_handles大于KCOV_REMOTE_MAX_HANDLES则返回:负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  如果是错误则返回:错误
693  kfree(remote_arg)
694  返回:负EINVAL
696  arg等于remote_arg
699  kcov等于 needed for tty driver, and maybe others
700  加自旋锁
701  res等于kcov_ioctl_locked(kcov, cmd, arg)
702  自旋锁解锁
704  kfree(remote_arg)
706  返回:res