21 #include <linux/kernel.h>
22 #include <linux/slab.h>
24 #include <asm/uaccess.h>
26 #define memzero(s,n) memset ((s),0,(n))
27 #define puts srm_printk
37 typedef unsigned char uch;
38 typedef unsigned short ush;
39 typedef unsigned long ulg;
47 static unsigned insize;
48 static unsigned inptr;
49 static unsigned outcnt;
52 #define ASCII_FLAG 0x01
53 #define CONTINUATION 0x02
54 #define EXTRA_FIELD 0x04
55 #define ORIG_NAME 0x08
57 #define ENCRYPTED 0x20
60 #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
64 # define Assert(cond,msg) {if(!(cond)) error(msg);}
65 # define Trace(x) fprintf x
66 # define Tracev(x) {if (verbose) fprintf x ;}
67 # define Tracevv(x) {if (verbose>1) fprintf x ;}
68 # define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
69 # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
71 # define Assert(cond,msg)
79 static int fill_inbuf(
void);
81 static void error(
char *
m);
84 static int input_data_size;
90 static void error(
char *
m);
91 static void gzip_mark(
void **);
92 static void gzip_release(
void **);
98 #define HEAP_SIZE 0x3000
100 #include "../../../lib/inflate.c"
109 error(
"ran out of input data");
112 insize = input_data_size;
130 for (n = 0; n < outcnt; n++) {
132 c = crc_32_tab[((
int)c ^ ch) & 0xff] ^ (c >> 8);
135 bytes_out += (
ulg)outcnt;
136 output_ptr += (
ulg)outcnt;
141 static void error(
char *
x)
145 puts(
"\n\n -- System halted");
156 output_data = (uch *)output_start;
157 input_data = (uch *)input_start;
158 input_data_size = kzsize;
161 free_mem_ptr = (
ulg)output_start + ksize;
162 free_mem_end_ptr = (
ulg)output_start + ksize + 0x200000;