decompress.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #define _LINUX_STRING_H_
  2. #include <linux/compiler.h> /* for inline */
  3. #include <linux/types.h> /* for size_t */
  4. #include <linux/stddef.h> /* for NULL */
  5. #include <linux/linkage.h>
  6. #include <asm/string.h>
  7. extern unsigned long free_mem_ptr;
  8. extern unsigned long free_mem_end_ptr;
  9. extern void error(char *);
  10. #define STATIC static
  11. #define STATIC_RW_DATA /* non-static please */
  12. #define ARCH_HAS_DECOMP_WDOG
  13. /* Diagnostic functions */
  14. #ifdef DEBUG
  15. # define Assert(cond,msg) {if(!(cond)) error(msg);}
  16. # define Trace(x) fprintf x
  17. # define Tracev(x) {if (verbose) fprintf x ;}
  18. # define Tracevv(x) {if (verbose>1) fprintf x ;}
  19. # define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
  20. # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
  21. #else
  22. # define Assert(cond,msg)
  23. # define Trace(x)
  24. # define Tracev(x)
  25. # define Tracevv(x)
  26. # define Tracec(c,x)
  27. # define Tracecv(c,x)
  28. #endif
  29. #ifdef CONFIG_KERNEL_GZIP
  30. #include "../../../../lib/decompress_inflate.c"
  31. #endif
  32. #ifdef CONFIG_KERNEL_LZO
  33. #include "../../../../lib/decompress_unlzo.c"
  34. #endif
  35. #ifdef CONFIG_KERNEL_LZMA
  36. #include "../../../../lib/decompress_unlzma.c"
  37. #endif
  38. int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
  39. {
  40. return decompress(input, len, NULL, NULL, output, NULL, error);
  41. }