49 struct image *extracted ) {
71 deflate_chunk_init ( &
out, extracted->
data, 0, extracted->
len );
75 DBGC ( extracted,
"ZLIB %p could not decompress: %s\n",
82 DBGC ( extracted,
"ZLIB %p decompression incomplete\n",
89 if (
out.offset == extracted->
len )
94 DBGC ( extracted,
"ZLIB %p could not resize: %s\n",
int deflate_inflate(struct deflate *deflate, struct deflate_chunk *in, struct deflate_chunk *out)
Inflate compressed data.
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
userptr_t data
Raw file image.
struct image_type zlib_image_type __image_type(PROBE_NORMAL)
zlib image type
#define ENOEXEC
Exec format error.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
An executable image type.
#define PROBE_NORMAL
Normal image probe priority.
Access to external ("user") memory.
char * name
Name of this image type.
static int zlib_extract(struct image *image, struct image *extracted)
Extract zlib image.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define ENOMEM
Not enough space.
void deflate_init(struct deflate *deflate, enum deflate_format format)
Initialise decompressor.
static int deflate_finished(struct deflate *deflate)
Check if decompression has finished.
int zlib_deflate(enum deflate_format format, struct deflate_chunk *in, struct image *extracted)
Extract compressed data to image.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
deflate_format
Compression formats.
void * zalloc(size_t size)
Allocate cleared memory.
size_t len
Length of raw file image.
static int zlib_magic_is_valid(union zlib_magic *magic)
Check that zlib magic header is valid.
uint16_t magic
Magic signature.
int image_set_len(struct image *image, size_t len)
Set image length.
static int zlib_probe(struct image *image)
Probe zlib image.
DEFLATE decompression algorithm.
int image_extract_exec(struct image *image)
Extract and execute image.