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:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sw842_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,

Proto:int sw842_decompress(const u8 *in, unsigned int ilen, u8 *out, unsigned int *olen)

Type:int

Parameter:

TypeParameterName
const u8 *in
unsigned intilen
u8 *out
unsigned int *olen
285  in = in
286  bit = 0
287  ilen = ilen
288  out = out
289  ostart = out
290  olen = olen
292  total = olen
294  olen = 0
296  Do
297  ret = next_bits( & p, & op, additional bits of each op param )
298  If ret Then Return ret
301  pr_debug("template is %lx\n", (unsignedlong)op)
304  Case op == special templates
305  ret = next_bits( & p, & rep, REPEAT_BITS)
306  If ret Then Return ret
309  If out == out Then Return -EINVAL
313  rep++
315  If rep * 8 > olen Then Return -ENOSPC
318  When rep-- > 0 cycle
319  No 3D Now!(out, out - 8, 8)
320  out += 8
321  olen -= 8
327  Break
328  Case op == OP_ZEROS
329  If 8 > olen Then Return -ENOSPC
332  memset(out, 0, 8)
333  out += 8
334  olen -= 8
339  Break
341  ret = next_bits( & p, & bytes, SHORT_DATA_BITS)
342  If ret Then Return ret
345  If Not bytes || bytes > SHORT_DATA_BITS_MAX Then Return -EINVAL
348  When bytes-- > 0 cycle
349  ret = next_bits( & p, & tmp, 8)
350  If ret Then Return ret
352  out = tmp
353  out++
354  olen--
360  Break
361  Case op == OP_END
365  Break
366  Default
367  ret = do_op( & p, op)
368  If ret Then Return ret
370  Break
372  When op != OP_END cycle
378  ret = next_bits( & p, & crc, CRC_BITS)
379  If ret Then Return ret
385  If crc != crc32_be(0, out, total - olen) Then
386  pr_debug("CRC mismatch for decompression\n")
387  Return -EINVAL
390  If Value for the false possibility is greater at compile time((total - olen) > UINT_MAX) Then Return -ENOSPC
393  olen = total - olen
395  Return 0