函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:add_bits

函数原型:static int add_bits(struct sw842_param *p, u64 d, u8 n)

返回类型:int

参数:

类型参数名称
struct sw842_param *p
u64d
u8n
169  b等于bit, bits等于b加n, s等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(bits, 8)减bits
171  out等于out
173  pr_debug("add %u bits %lx\n", (unsignedchar)n, (unsignedlong)d)
175  如果n大于64则返回:负EINVAL
181  如果bits大于64则返回:__split_add_bits(p, d, n, 32)
183  否则如果olen小于8且bits大于32且bits小于等于56则返回:__split_add_bits(p, d, n, 16)
185  否则如果olen小于4且bits大于16且bits小于等于24则返回:__split_add_bits(p, d, n, 8)
188  如果DIV_ROUND_UP(bits, 8)大于olen则返回:负ENOSPC
191  o等于out按位与bmask[b]
192  d左移等于s
194  如果bits小于等于8则out等于o按位或d
196  否则如果bits小于等于16则put_unaligned(cpu_to_be16(o << 8 | d), (__be16 * )out)
198  否则如果bits小于等于24则put_unaligned(cpu_to_be32(o << 24 | d << 8), (__be32 * )out)
200  否则如果bits小于等于32则put_unaligned(cpu_to_be32(o << 24 | d), (__be32 * )out)
202  否则如果bits小于等于40则put_unaligned(cpu_to_be64(o << 56 | d << 24), (__be64 * )out)
204  否则如果bits小于等于48则put_unaligned(cpu_to_be64(o << 56 | d << 16), (__be64 * )out)
206  否则如果bits小于等于56则put_unaligned(cpu_to_be64(o << 56 | d << 8), (__be64 * )out)
208  否则put_unaligned(cpu_to_be64(o << 56 | d), (__be64 * )out)
211  bit加等于n
213  如果bit大于7则
214  out加等于bit除8
215  olen减等于bit除8
216  bit取模等于8
219  返回:0
调用者
名称描述
__split_add_bits
add_template
add_repeat_template
add_short_data_template
add_zeros_template
add_end_template
sw842_compresssw842_compress* Compress the uncompressed buffer of length @ilen at @in to the output buffer*@out, using no more than @olen bytes, using the 842 compression format