函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__bitmap_parse - convert an ASCII hex string into a bitmap

函数原型:int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, unsigned long *maskp, int nmaskbits)

返回类型:int

参数:

类型参数名称
const char *buf
unsigned intbuflen
intis_user
unsigned long *maskp
intnmaskbits
394  const char __user __force * ubuf = buf
396  bitmap_zero(maskp, nmaskbits)
398  nchunks等于nbits等于totaldigits等于c等于0
399  循环
400  chunk等于0
401  ndigits等于totaldigits
404 buflen循环
405  old_c等于c
406  如果is_user
410  否则c等于buf自加
412  buflen自减
413  如果Note: isspace() must return false for %NUL-terminator (c)则继续下一循环
425  如果c恒等于'\0'或c恒等于','则退出
428  如果非isxdigit(c)则返回:负EINVAL
439  chunk等于chunk左移4位按位或十六进制数字转换为实数
440  totaldigits自加
442  如果ndigits恒等于totaldigits则返回:负EINVAL
444  如果nchunks恒等于0且chunk恒等于0则继续下一循环
447  __bitmap_shift_left - logical left shift of the bits in a bitmap*@dst : destination bitmap*@src : source bitmap*@shift : shift by this many bits*@nbits : bitmap size, in bits* Shifting left (multiplying) means moving bits in the LS -> MS* direction
448  maskp或等于chunk
449  nchunks自加
450  nbits加等于如果nchunks恒等于1则nbits_to_hold_value(chunk)否则Bitmap printing & parsing functions: first version by Nadia Yvette Chambers,* second version by Paul Jackson, third by Joe Korty.
451  如果nbits大于nmaskbits则返回:负EOVERFLOW
453 buflenc恒等于','循环
455  返回:0
调用者
名称描述
bitmap_parse_usermap_parse_user - convert an ASCII hex string in a user buffer into a bitmap*@ubuf: pointer to user buffer containing string.*@ulen: buffer size in bytes. If string is smaller than this* then it must be terminated with a \0.
bitmap_parse