函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kfifo_copy_to_user

函数原型:static unsigned long kfifo_copy_to_user(struct __kfifo *fifo, void __user *to, unsigned int len, unsigned int off, unsigned int *copied)

返回类型:unsigned long

参数:

类型参数名称
struct __kfifo *fifo
void __user *to
unsigned intlen
unsigned intoff
unsigned int *copied
241  size等于mask加1
242  esize等于esize
244  off与等于mask
245  如果esize不等于1则
246  off乘等于esize
247  size乘等于esize
248  len乘等于esize
250  l等于两数取小(len, size - off)
252  ret等于copy_to_user(to, data + off, l)
253  如果此条件成立可能性小(为编译器优化)(ret)则ret等于DIV_ROUND_UP(ret + len - l, esize)
255  否则
256  ret等于copy_to_user(to + l, data, len - l)
257  如果此条件成立可能性小(为编译器优化)(ret)则ret等于DIV_ROUND_UP(ret, esize)
264  smp_wmb()
265  copied等于lenretesize
267  返回:ret
调用者
名称描述
__kfifo_to_user
__kfifo_to_user_r