hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/lib/zlib_inflate/infutil.h
....@@ -12,14 +12,28 @@
1212 #define _INFUTIL_H
1313
1414 #include <linux/zlib.h>
15
+#ifdef CONFIG_ZLIB_DFLTCC
16
+#include "../zlib_dfltcc/dfltcc.h"
17
+#include <asm/page.h>
18
+#endif
1519
1620 /* memory allocation for inflation */
1721
1822 struct inflate_workspace {
1923 struct inflate_state inflate_state;
20
- unsigned char working_window[1 << MAX_WBITS];
24
+#ifdef CONFIG_ZLIB_DFLTCC
25
+ struct dfltcc_state dfltcc_state;
26
+ unsigned char working_window[(1 << MAX_WBITS) + PAGE_SIZE];
27
+#else
28
+ unsigned char working_window[(1 << MAX_WBITS)];
29
+#endif
2130 };
2231
23
-#define WS(z) ((struct inflate_workspace *)(z->workspace))
32
+#ifdef CONFIG_ZLIB_DFLTCC
33
+/* dfltcc_state must be doubleword aligned for DFLTCC call */
34
+static_assert(offsetof(struct inflate_workspace, dfltcc_state) % 8 == 0);
35
+#endif
36
+
37
+#define WS(strm) ((struct inflate_workspace *)(strm->workspace))
2438
2539 #endif