diff options
author | 2017-04-25 03:31:15 -0700 | |
---|---|---|
committer | 2017-05-22 06:48:08 +0000 | |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/u-boot/fs/cramfs/uncompress.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/u-boot/fs/cramfs/uncompress.c')
-rw-r--r-- | qemu/roms/u-boot/fs/cramfs/uncompress.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/qemu/roms/u-boot/fs/cramfs/uncompress.c b/qemu/roms/u-boot/fs/cramfs/uncompress.c deleted file mode 100644 index f431cc46c..000000000 --- a/qemu/roms/u-boot/fs/cramfs/uncompress.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * uncompress.c - * - * Copyright (C) 1999 Linus Torvalds - * Copyright (C) 2000-2002 Transmeta Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License (Version 2) as - * published by the Free Software Foundation. - * - * cramfs interfaces to the uncompression library. There's really just - * three entrypoints: - * - * - cramfs_uncompress_init() - called to initialize the thing. - * - cramfs_uncompress_exit() - tell me when you're done - * - cramfs_uncompress_block() - uncompress a block. - * - * NOTE NOTE NOTE! The uncompression is entirely single-threaded. We - * only have one stream, and we'll initialize it only once even if it - * then is used by multiple filesystems. - */ - -#include <common.h> -#include <malloc.h> -#include <watchdog.h> -#include <u-boot/zlib.h> - -static z_stream stream; - -/* Returns length of decompressed data. */ -int cramfs_uncompress_block (void *dst, void *src, int srclen) -{ - int err; - - inflateReset (&stream); - - stream.next_in = src; - stream.avail_in = srclen; - - stream.next_out = dst; - stream.avail_out = 4096 * 2; - - err = inflate (&stream, Z_FINISH); - - if (err != Z_STREAM_END) - goto err; - return stream.total_out; - - err: - /*printf ("Error %d while decompressing!\n", err); */ - /*printf ("%p(%d)->%p\n", src, srclen, dst); */ - return -1; -} - -int cramfs_uncompress_init (void) -{ - int err; - - stream.zalloc = gzalloc; - stream.zfree = gzfree; - stream.next_in = 0; - stream.avail_in = 0; - -#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) - stream.outcb = (cb_func) WATCHDOG_RESET; -#else - stream.outcb = Z_NULL; -#endif /* CONFIG_HW_WATCHDOG */ - - err = inflateInit (&stream); - if (err != Z_OK) { - printf ("Error: inflateInit2() returned %d\n", err); - return -1; - } - - return 0; -} - -int cramfs_uncompress_exit (void) -{ - inflateEnd (&stream); - return 0; -} |