cudbg_zlib.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2018 Chelsio Communications. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. *
  16. */
  17. #ifndef __CUDBG_ZLIB_H__
  18. #define __CUDBG_ZLIB_H__
  19. #include <linux/zlib.h>
  20. #define CUDBG_ZLIB_COMPRESS_ID 17
  21. #define CUDBG_ZLIB_WIN_BITS 12
  22. #define CUDBG_ZLIB_MEM_LVL 4
  23. struct cudbg_compress_hdr {
  24. u32 compress_id;
  25. u64 decompress_size;
  26. u64 compress_size;
  27. u64 rsvd[32];
  28. };
  29. static inline int cudbg_get_workspace_size(void)
  30. {
  31. return zlib_deflate_workspacesize(CUDBG_ZLIB_WIN_BITS,
  32. CUDBG_ZLIB_MEM_LVL);
  33. }
  34. int cudbg_compress_buff(struct cudbg_init *pdbg_init,
  35. struct cudbg_buffer *pin_buff,
  36. struct cudbg_buffer *pout_buff);
  37. #endif /* __CUDBG_ZLIB_H__ */