函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__reg_op

函数原型:static int __reg_op(unsigned long *bitmap, unsigned int pos, int order, int reg_op)

返回类型:int

参数:

类型参数名称
unsigned long *bitmap
unsigned intpos
intorder
intreg_op
1053  ret等于0
1059  nbits_reg等于1左移order
1060  index等于posBITS_PER_LONG
1061  offset等于posindexBITS_PER_LONG
1062  nlongs_reg等于BITS_TO_LONGS(nbits_reg)
1063  nbitsinlong等于两数取小(nbits_reg, BITS_PER_LONG)
1069  mask等于1UL左移nbitsinlong减1位
1070  mask加等于mask减1
1071  mask左移等于offset
1074  :reg_op恒等于REG_OP_ISFREE
1075 i小于nlongs_reg循环
1076  如果bitmap[index + i]按位与mask则转到:done
1079  ret等于1
1080  退出
1082  :reg_op恒等于REG_OP_ALLOC
1083 i小于nlongs_reg循环bitmap[index + i]或等于mask
1085  退出
1087  :reg_op恒等于REG_OP_RELEASE
1088 i小于nlongs_reg循环bitmap[index + i]与等于mask的反
1090  退出
1092  done :
1093  返回:ret
调用者
名称描述
bitmap_find_free_regionmap_find_free_region - find a contiguous aligned mem region*@bitmap: array of unsigned longs corresponding to the bitmap*@bits: number of bits in the bitmap*@order: region size (log base 2 of number of bits) to find* Find a region of free (zero) bits in a
bitmap_release_regionmap_release_region - release allocated bitmap region*@bitmap: array of unsigned longs corresponding to the bitmap*@pos: beginning of bit region to release*@order: region size (log base 2 of number of bits) to release* This is the complement to
bitmap_allocate_regionmap_allocate_region - allocate bitmap region*@bitmap: array of unsigned longs corresponding to the bitmap*@pos: beginning of bit region to allocate*@order: region size (log base 2 of number of bits) to allocate