infutil.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* infutil.h -- types and macros common to blocks and codes
  2. * Copyright (C) 1995-1998 Mark Adler
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. /* WARNING: this file should *not* be used by applications. It is
  6. part of the implementation of the compression library and is
  7. subject to change. Applications should only use zlib.h.
  8. */
  9. #ifndef _INFUTIL_H
  10. #define _INFUTIL_H
  11. #include <linux/zlib.h>
  12. #ifdef CONFIG_ZLIB_DFLTCC
  13. #include "../zlib_dfltcc/dfltcc.h"
  14. #include <asm/page.h>
  15. #endif
  16. /* memory allocation for inflation */
  17. struct inflate_workspace {
  18. struct inflate_state inflate_state;
  19. #ifdef CONFIG_ZLIB_DFLTCC
  20. struct dfltcc_state dfltcc_state;
  21. unsigned char working_window[(1 << MAX_WBITS) + PAGE_SIZE];
  22. #else
  23. unsigned char working_window[(1 << MAX_WBITS)];
  24. #endif
  25. };
  26. #ifdef CONFIG_ZLIB_DFLTCC
  27. /* dfltcc_state must be doubleword aligned for DFLTCC call */
  28. static_assert(offsetof(struct inflate_workspace, dfltcc_state) % 8 == 0);
  29. #endif
  30. #define WS(strm) ((struct inflate_workspace *)(strm->workspace))
  31. #endif