Back to home page

OSCL-LXR

 
 

    


0001 /* infutil.h -- types and macros common to blocks and codes
0002  * Copyright (C) 1995-1998 Mark Adler
0003  * For conditions of distribution and use, see copyright notice in zlib.h 
0004  */
0005 
0006 /* WARNING: this file should *not* be used by applications. It is
0007    part of the implementation of the compression library and is
0008    subject to change. Applications should only use zlib.h.
0009  */
0010 
0011 #ifndef _INFUTIL_H
0012 #define _INFUTIL_H
0013 
0014 #include <linux/zlib.h>
0015 #ifdef CONFIG_ZLIB_DFLTCC
0016 #include "../zlib_dfltcc/dfltcc.h"
0017 #include <asm/page.h>
0018 #endif
0019 
0020 /* memory allocation for inflation */
0021 
0022 struct inflate_workspace {
0023     struct inflate_state inflate_state;
0024 #ifdef CONFIG_ZLIB_DFLTCC
0025     struct dfltcc_state dfltcc_state;
0026     unsigned char working_window[(1 << MAX_WBITS) + PAGE_SIZE];
0027 #else
0028     unsigned char working_window[(1 << MAX_WBITS)];
0029 #endif
0030 };
0031 
0032 #ifdef CONFIG_ZLIB_DFLTCC
0033 /* dfltcc_state must be doubleword aligned for DFLTCC call */
0034 static_assert(offsetof(struct inflate_workspace, dfltcc_state) % 8 == 0);
0035 #endif
0036 
0037 #define WS(strm) ((struct inflate_workspace *)(strm->workspace))
0038 
0039 #endif