Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:next_bits

Proto:static int next_bits(struct sw842_param *p, u64 *d, u8 n)

Type:int

Parameter:

TypeParameterName
struct sw842_param *p
u64 *d
u8n
89  in = in , b = bit , bits = b + n
91  If n > 64 Then
92  pr_debug("next_bits invalid n %u\n", n)
93  Return -EINVAL
99  If bits > 64 Then Return __split_next_bits(p, d, n, 32)
101  Else if ilen < 8 && bits > 32 && bits <= 56 Then Return __split_next_bits(p, d, n, 16)
103  Else if ilen < 4 && bits > 16 && bits <= 24 Then Return __split_next_bits(p, d, n, 8)
106  If DIV_ROUND_UP(bits, 8) > ilen Then Return -EOVERFLOW
109  If bits <= 8 Then d = in >> 8 - bits
111  Else if bits <= 16 Then d = be16_to_cpu(get value from possibly mis-aligned location((__be16 * )in)) >> 16 - bits
113  Else if bits <= 32 Then d = be32_to_cpu(get value from possibly mis-aligned location((__be32 * )in)) >> 32 - bits
115  Else d = be64_to_cpu(get value from possibly mis-aligned location((__be64 * )in)) >> 64 - bits
118  d &= GENMASK_ULL(n - 1, 0)
120  bit += n
122  If bit > 7 Then
123  in += bit / 8
124  ilen -= bit / 8
125  bit %= 8
128  Return 0
Caller
NameDescribe
__split_next_bits
do_data
__do_index
sw842_decompresssw842_decompress* Decompress the 842-compressed buffer of length @ilen at @in* to the output buffer @out, using no more than @olen bytes.* The compressed buffer must be only a single 842-compressed buffer,