Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__bitmap_shift_right - logical right 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 right (dividing) means moving bits in the MS -> LS bit* direction

Proto:void __bitmap_shift_right(unsigned long *dst, const unsigned long *src, unsigned shift, unsigned nbits)

Type:void

Parameter:

TypeParameterName
unsigned long *dst
const unsigned long *src
unsignedshift
unsignednbits
104  lim = BITS_TO_LONGS(nbits)
105  off = shift / BITS_PER_LONG , rem = shift % BITS_PER_LONG
106  mask = BITMAP_LAST_WORD_MASK(nbits)
107  When off + k < lim cycle
114  If Not rem || off + k + 1 >= lim Then upper = 0
116  Else
117  upper = src[off + k + 1]
118  If off + k + 1 == lim - 1 Then upper &= mask
120  upper <<= BITS_PER_LONG - rem
122  lower = src[off + k]
123  If off + k == lim - 1 Then lower &= mask
125  lower >>= rem
126  dst[k] = lower | upper
128  If off Then memset( & dst[lim - off], 0, off * sizeof(unsignedlong))