of: MSI: Simplify irqdomain lookup
[linux/fpc-iii.git] / arch / h8300 / boot / compressed / misc.c
blob6029c53518951a1253b498d77e1b4d963b9d36b9
1 /*
2 * arch/h8300/boot/compressed/misc.c
4 * This is a collection of several routines from gzip-1.0.3
5 * adapted for Linux.
7 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
9 * Adapted for h8300 by Yoshinori Sato 2006
12 #include <asm/uaccess.h>
15 * gzip declarations
18 #define OF(args) args
19 #define STATIC static
21 #undef memset
22 #undef memcpy
23 #define memzero(s, n) memset((s), (0), (n))
25 extern int _end;
26 static unsigned long free_mem_ptr;
27 static unsigned long free_mem_end_ptr;
29 extern char input_data[];
30 extern int input_len;
31 extern char output[];
33 #define HEAP_SIZE 0x10000
35 #include "../../../../lib/decompress_inflate.c"
37 void *memset(void *s, int c, size_t n)
39 int i;
40 char *ss = (char *)s;
42 for (i = 0; i < n; i++)
43 ss[i] = c;
44 return s;
47 void *memcpy(void *dest, const void *src, size_t n)
49 int i;
50 char *d = (char *)dest, *s = (char *)src;
52 for (i = 0; i < n; i++)
53 d[i] = s[i];
54 return dest;
57 static void error(char *x)
59 while (1)
60 ; /* Halt */
63 void decompress_kernel(void)
65 free_mem_ptr = (unsigned long)&_end;
66 free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
68 __decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error);