X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=arch%2Farm%2Fboot%2Fcompressed%2Fmisc.c;h=7145cc7c04f0b8e36fb4b86205602fa7e0618bac;hp=ace3fb5835d9278833a0c539b8fff0b74e8af885;hb=837b41b5de356aa67abb2cadb5eef3efc7776f91;hpb=59f720eb5a4337b2c4fc0b4c6cfd9c144e492aa8 diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index ace3fb5835d9..7145cc7c04f0 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c @@ -30,6 +30,25 @@ static void putstr(const char *ptr); #include #ifdef CONFIG_DEBUG_ICEDCC + +#ifdef CONFIG_CPU_V6 + +static void icedcc_putc(int ch) +{ + int status, i = 0x4000000; + + do { + if (--i < 0) + return; + + asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status)); + } while (status & (1 << 29)); + + asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch)); +} + +#else + static void icedcc_putc(int ch) { int status, i = 0x4000000; @@ -44,6 +63,8 @@ static void icedcc_putc(int ch) asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch)); } +#endif + #define putc(ch) icedcc_putc(ch) #define flush() do { } while (0) #endif @@ -196,8 +217,6 @@ static unsigned outcnt; /* bytes in output buffer */ static int fill_inbuf(void); static void flush_window(void); static void error(char *m); -static void gzip_mark(void **); -static void gzip_release(void **); extern char input_data[]; extern char input_data_end[]; @@ -206,64 +225,21 @@ static uch *output_data; static ulg output_ptr; static ulg bytes_out; -static void *malloc(int size); -static void free(void *where); static void error(char *m); -static void gzip_mark(void **); -static void gzip_release(void **); static void putstr(const char *); extern int end; static ulg free_mem_ptr; -static ulg free_mem_ptr_end; +static ulg free_mem_end_ptr; -#define HEAP_SIZE 0x2000 - -#include "../../../../lib/inflate.c" - -#ifndef STANDALONE_DEBUG -static void *malloc(int size) -{ - void *p; - - if (size <0) error("Malloc error"); - if (free_mem_ptr <= 0) error("Memory error"); - - free_mem_ptr = (free_mem_ptr + 3) & ~3; /* Align */ - - p = (void *)free_mem_ptr; - free_mem_ptr += size; - - if (free_mem_ptr >= free_mem_ptr_end) - error("Out of memory"); - return p; -} - -static void free(void *where) -{ /* gzip_mark & gzip_release do the free */ -} - -static void gzip_mark(void **ptr) -{ - arch_decomp_wdog(); - *ptr = (void *) free_mem_ptr; -} +#ifdef STANDALONE_DEBUG +#define NO_INFLATE_MALLOC +#endif -static void gzip_release(void **ptr) -{ - arch_decomp_wdog(); - free_mem_ptr = (long) *ptr; -} -#else -static void gzip_mark(void **ptr) -{ -} +#define ARCH_HAS_DECOMP_WDOG -static void gzip_release(void **ptr) -{ -} -#endif +#include "../../../../lib/inflate.c" /* =========================================================================== * Fill the input buffer. This is called only when the buffer is empty @@ -327,7 +303,7 @@ decompress_kernel(ulg output_start, ulg free_mem_ptr_p, ulg free_mem_ptr_end_p, { output_data = (uch *)output_start; /* Points to kernel start */ free_mem_ptr = free_mem_ptr_p; - free_mem_ptr_end = free_mem_ptr_end_p; + free_mem_end_ptr = free_mem_ptr_end_p; __machine_arch_type = arch_id; arch_decomp_setup();