Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\decompress_unlzo.c Create Date:2022-07-28 06:17:34
Last Modify:2020-03-15 22:52:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:unlzo

Proto:STATIC int __attribute__((__section__(".init.text"))) __attribute__((__cold__))unlzo(u8 *input, long in_len, long (*fill)(void *, unsigned long ), long (*flush)(void *, unsigned long ), u8 *output, long *posp, void (*error)(char *x))

Type:int

Parameter:

TypeParameterName
u8 *input
longin_len
long (*fill
long (*flush
u8 *output
long *posp
void (*error
104  r = 0
105  skip = 0
109  ret = -1
111  If output Then
112  out_buf = output
113  Else if Not flush Then
114  error("NULL output pointer and no flush function provided")
115  Go to exit
116  Else
117  out_buf = 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 (LZO_BLOCK_SIZE)
118  If Not out_buf Then
119  error("Could not allocate output buffer")
120  Go to exit
124  If input && fill Then
125  error("Both input pointer and fill function provided, don't know what to do")
126  Go to exit_1
127  Else if input Then
128  in_buf = input
129  Else if Not fill Then
130  error("NULL input pointer and missing fill function")
131  Go to exit_1
132  Else
133  in_buf = 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 (lzo1x_worst_compress(LZO_BLOCK_SIZE))
134  If Not in_buf Then
135  error("Could not allocate input buffer")
136  Go to exit_1
139  in_buf_save = in_buf
141  If posp Then posp = 0
144  If fill Then
151  in_buf += HEADER_SIZE_MAX
152  in_len = fill(in_buf, HEADER_SIZE_MAX)
155  If Not parse_header(in_buf, & skip, in_len) Then
156  error("invalid header")
157  Go to exit_2
159  in_buf += skip
160  in_len -= skip
162  If fill Then
164  No 3D Now!(in_buf_save, in_buf, in_len)
165  in_buf = in_buf_save
168  If posp Then posp = skip
171  cycle
173  If fill && in_len < 4 Then
174  skip = fill(in_buf + in_len, 4 - in_len)
175  If skip > 0 Then in_len += skip
178  If in_len < 4 Then
179  error("file corrupted")
180  Go to exit_2
182  dst_len = get_unaligned_be32(in_buf)
183  in_buf += 4
184  in_len -= 4
187  If dst_len == 0 Then
188  If posp Then posp += 4
190  Break
193  If dst_len > LZO_BLOCK_SIZE Then
194  error("dest len longer than block size")
195  Go to exit_2
199  If fill && in_len < 8 Then
200  skip = fill(in_buf + in_len, 8 - in_len)
201  If skip > 0 Then in_len += skip
204  If in_len < 8 Then
205  error("file corrupted")
206  Go to exit_2
208  src_len = get_unaligned_be32(in_buf)
209  in_buf += 8
210  in_len -= 8
212  If src_len <= 0 || src_len > dst_len Then
213  error("file corrupted")
214  Go to exit_2
218  If fill && in_len < src_len Then
220  If skip > 0 Then in_len += skip
223  If in_len < src_len Then
224  error("file corrupted")
225  Go to exit_2
227  tmp = dst_len
232  If Value for the false possibility is greater at compile time(dst_len == src_len) Then No 3D Now!(out_buf, in_buf, src_len)
234  Else
238  If r != Return values (< 0 = Error) || dst_len != tmp Then
239  error("Compressed data violation")
240  Go to exit_2
244  If flush && flush(out_buf, dst_len) != dst_len Then Go to exit_2
246  If output Then out_buf += dst_len
248  If posp Then posp += src_len + 12
251  in_buf += src_len
252  in_len -= src_len
253  If fill Then
259  If in_len > 0 Then When skip < in_len cycle
266  ret = 0
267  exit_2 :
268  If Not input Then free(in_buf_save)
270  exit_1 :
271  If Not output Then free(out_buf)
273  exit :
274  Return ret
Caller
NameDescribe
__decompress