mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
[new uImage] Move gunzip() common code to common/gunzip.c
Move gunzip(), zalloc() and zfree() to a separate file. Share zalloc() and zfree() with cramfs uncompress routine. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
This commit is contained in:
parent
d45d5a18b6
commit
321359f208
5 changed files with 123 additions and 109 deletions
|
@ -29,24 +29,8 @@
|
|||
|
||||
static z_stream stream;
|
||||
|
||||
#define ZALLOC_ALIGNMENT 16
|
||||
|
||||
static void *zalloc (void *x, unsigned items, unsigned size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
size *= items;
|
||||
size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
|
||||
|
||||
p = malloc (size);
|
||||
|
||||
return (p);
|
||||
}
|
||||
|
||||
static void zfree (void *x, void *addr, unsigned nb)
|
||||
{
|
||||
free (addr);
|
||||
}
|
||||
void *zalloc(void *, unsigned, unsigned);
|
||||
void zfree(void *, void *, unsigned);
|
||||
|
||||
/* Returns length of decompressed data. */
|
||||
int cramfs_uncompress_block (void *dst, void *src, int srclen)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue