162306a36Sopenharmony_ci/* infutil.h -- types and macros common to blocks and codes
262306a36Sopenharmony_ci * Copyright (C) 1995-1998 Mark Adler
362306a36Sopenharmony_ci * For conditions of distribution and use, see copyright notice in zlib.h
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci/* WARNING: this file should *not* be used by applications. It is
762306a36Sopenharmony_ci   part of the implementation of the compression library and is
862306a36Sopenharmony_ci   subject to change. Applications should only use zlib.h.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#ifndef _INFUTIL_H
1262306a36Sopenharmony_ci#define _INFUTIL_H
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#include <linux/zlib.h>
1562306a36Sopenharmony_ci#ifdef CONFIG_ZLIB_DFLTCC
1662306a36Sopenharmony_ci#include "../zlib_dfltcc/dfltcc.h"
1762306a36Sopenharmony_ci#include <asm/page.h>
1862306a36Sopenharmony_ci#endif
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci/* memory allocation for inflation */
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cistruct inflate_workspace {
2362306a36Sopenharmony_ci	struct inflate_state inflate_state;
2462306a36Sopenharmony_ci#ifdef CONFIG_ZLIB_DFLTCC
2562306a36Sopenharmony_ci	struct dfltcc_state dfltcc_state;
2662306a36Sopenharmony_ci	unsigned char working_window[(1 << MAX_WBITS) + PAGE_SIZE];
2762306a36Sopenharmony_ci#else
2862306a36Sopenharmony_ci	unsigned char working_window[(1 << MAX_WBITS)];
2962306a36Sopenharmony_ci#endif
3062306a36Sopenharmony_ci};
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci#ifdef CONFIG_ZLIB_DFLTCC
3362306a36Sopenharmony_ci/* dfltcc_state must be doubleword aligned for DFLTCC call */
3462306a36Sopenharmony_cistatic_assert(offsetof(struct inflate_workspace, dfltcc_state) % 8 == 0);
3562306a36Sopenharmony_ci#endif
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#define WS(strm) ((struct inflate_workspace *)(strm->workspace))
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#endif
40