| // SPDX-License-Identifier: GPL-2.0 |
| * arch/h8300/boot/compressed/misc.c |
| * This is a collection of several routines from gzip-1.0.3 |
| * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 |
| * Adapted for h8300 by Yoshinori Sato 2006 |
| #include <linux/uaccess.h> |
| #define memzero(s, n) memset((s), (0), (n)) |
| static unsigned long free_mem_ptr; |
| static unsigned long free_mem_end_ptr; |
| extern char input_data[]; |
| #define HEAP_SIZE 0x10000 |
| #ifdef CONFIG_KERNEL_GZIP |
| #include "../../../../lib/decompress_inflate.c" |
| #include "../../../../lib/decompress_unlzo.c" |
| void *memset(void *s, int c, size_t n) |
| void *memcpy(void *dest, const void *src, size_t n) |
| char *d = (char *)dest, *s = (char *)src; |
| static void error(char *x) |
| void decompress_kernel(void) |
| free_mem_ptr = (unsigned long)&_end; |
| free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; |
| __decompress(input_data, input_len, NULL, NULL, output, 0, NULL, error); |