Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\bitmap.c Create Date:2022-07-28 06:20:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__reg_op

Proto:static int __reg_op(unsigned long *bitmap, unsigned int pos, int order, int reg_op)

Type:int

Parameter:

TypeParameterName
unsigned long *bitmap
unsigned intpos
intorder
intreg_op
1053  ret = 0
1059  nbits_reg = 1 << order
1060  index = pos / BITS_PER_LONG
1061  offset = pos - index * BITS_PER_LONG
1062  nlongs_reg = BITS_TO_LONGS(nbits_reg)
1063  nbitsinlong = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(nbits_reg, BITS_PER_LONG)
1069  mask = 1UL << nbitsinlong - 1
1070  mask += mask - 1
1071  mask <<= offset
1074  Case reg_op == REG_OP_ISFREE
1075  When i < nlongs_reg cycle
1076  If bitmap[index + i] & mask Then Go to done
1079  ret = 1
1080  Break
1082  Case reg_op == REG_OP_ALLOC
1083  When i < nlongs_reg cycle bitmap[index + i] |= mask
1085  Break
1087  Case reg_op == REG_OP_RELEASE
1088  When i < nlongs_reg cycle bitmap[index + i] &= ~mask
1090  Break
1092  done :
1093  Return ret
Caller
NameDescribe
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