函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\decompress_unxz.c Create Date:2022-07-27 07:14:48
Last Modify:2020-03-15 22:53:09 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This function implements the API defined in <linux/decompress/generic.h>.* This wrapper will automatically choose single-call or multi-call mode* of the native XZ decoder API. The single-call mode can be used only when

函数原型:STATIC int __attribute__((__section__(".init.text"))) __attribute__((__cold__))unxz(unsigned char *in, long in_size, long (*fill)(void *dest, unsigned long size), long (*flush)(void *src, unsigned long size), unsigned char *out, long *in_used, void (*error)(char *x))

返回类型:int

参数:

类型参数名称
unsigned char *in
longin_size
long (*fill
long (*flush
unsigned char *out
long *in_used
void (*error
260  bool must_free_in = false
263  xz_crc32_init()
266  如果(in_used != NULL)则in_used等于0
269  如果(fill == NULL && flush == NULL)则s等于xz_dec_init(XZ_SINGLE, 0)
271  否则s等于xz_dec_init(XZ_DYNALLOC, (uint32_t) - 1)
274  如果(s == NULL)则转到:error_alloc_state
277  如果(flush == NULL)则
278  out等于out
279  out_size = (size_t) - 1
280  否则
281  out_size等于Size of the input and output buffers in multi-call mode
282  out等于Use defines rather than static inline in order to avoid spurious* warnings when not needed (indeed large_malloc / large_free are not* needed by inflate (Size of the input and output buffers in multi-call mode )
283  如果(out == NULL)则转到:error_alloc_out
287  如果(in == NULL)则
288  must_free_in = true
289  in等于Use defines rather than static inline in order to avoid spurious* warnings when not needed (indeed large_malloc / large_free are not* needed by inflate (Size of the input and output buffers in multi-call mode )
290  如果(in == NULL)则转到:error_alloc_in
294  in等于in
295  in_pos等于0
296  in_size等于in_size
297  out_pos等于0
299  如果(fill == NULL && flush == NULL)则
300  ret等于xz_dec_run() is a wrapper for dec_main() to handle some special cases in* multi-call and single-call decoding.* In multi-call mode, we must return XZ_BUF_ERROR when it seems clear that we* are not going to make any progress anymore
301  否则
302  循环
303  如果(in_pos == in_size && fill != NULL)则
304  如果(in_used != NULL)则in_used加等于in_pos
307  in_pos等于0
310  如果in_size小于0则
316  ret等于XZ_BUF_ERROR
317  退出
320  in_size等于in_size
325  如果flush不等于NULLout_pos恒等于out_sizeret不等于XZ_OKout_pos大于0的值则
332  如果flush(out, out_pos)不等于out_posret等于XZ_BUF_ERROR
335  out_pos等于0
337 ret恒等于XZ_OK循环
339  如果must_free_infree(in)
342  如果(flush != NULL)则free(out)
346  如果(in_used != NULL)则in_used加等于in_pos
349  释放解码器分配的内存
352  :ret恒等于XZ_STREAM_END
353  返回:0
355  :ret恒等于XZ_MEM_ERROR
357  error("XZ decompressor ran out of memory")
358  退出
360  :ret恒等于XZ_FORMAT_ERROR
361  error("Input is not in the XZ format (wrong magic bytes)")
362  退出
364  :ret恒等于XZ_OPTIONS_ERROR
365  error("Input was encoded with settings that are not supported by this XZ decoder")
367  退出
369  :ret恒等于XZ_DATA_ERROR
370  :ret恒等于XZ_BUF_ERROR
371  error("XZ-compressed data is corrupt")
372  退出
374  默认
375  error("Bug in the XZ decompressor")
376  退出
379  返回:负1
381  error_alloc_in :
382  如果(flush != NULL)则free(out)
385  error_alloc_out :
386  释放解码器分配的内存
388  error_alloc_state :
389  error("XZ decompressor ran out of memory")
390  返回:负1
调用者
名称描述
__decompressThis macro is used by architecture-specific files to decompress* the kernel image.