2 * arch/h8300/boot/compressed/misc.c
4 * This is a collection of several routines from gzip-1.0.3
7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
9 * Adapted for h8300 by Yoshinori Sato 2006
12 #include <linux/uaccess.h>
23 #define memzero(s, n) memset((s), (0), (n))
26 static unsigned long free_mem_ptr
;
27 static unsigned long free_mem_end_ptr
;
29 extern char input_data
[];
33 #define HEAP_SIZE 0x10000
35 #ifdef CONFIG_KERNEL_GZIP
36 #include "../../../../lib/decompress_inflate.c"
39 #ifdef CONFIG_KERNEL_LZO
40 #include "../../../../lib/decompress_unlzo.c"
43 void *memset(void *s
, int c
, size_t n
)
48 for (i
= 0; i
< n
; i
++)
53 void *memcpy(void *dest
, const void *src
, size_t n
)
56 char *d
= (char *)dest
, *s
= (char *)src
;
58 for (i
= 0; i
< n
; i
++)
63 static void error(char *x
)
69 void decompress_kernel(void)
71 free_mem_ptr
= (unsigned long)&_end
;
72 free_mem_end_ptr
= free_mem_ptr
+ HEAP_SIZE
;
74 __decompress(input_data
, input_len
, NULL
, NULL
, output
, 0, NULL
, error
);