X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fsh%2Fboot%2Fcompressed%2Fmisc.c;h=1ed7425a44678d474e3b2c188249f07d16533f54;hb=5e3b93f248c98873cc843e83092bb8da92ac85a2;hp=211e9110074f9cc2d4e15753c52a05d10f3860d6;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c index 211e91100..1ed7425a4 100644 --- a/arch/sh/boot/compressed/misc.c +++ b/arch/sh/boot/compressed/misc.c @@ -1,7 +1,7 @@ /* * arch/sh/boot/compressed/misc.c - * - * This is a collection of several routines from gzip-1.0.3 + * + * This is a collection of several routines from gzip-1.0.3 * adapted for Linux. * * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 @@ -52,7 +52,7 @@ static unsigned outcnt = 0; /* bytes in output buffer */ #define RESERVED 0xC0 /* bit 6,7: reserved */ #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) - + /* Diagnostic functions */ #ifdef DEBUG # define Assert(cond,msg) {if(!(cond)) error(msg);} @@ -75,7 +75,7 @@ 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 int input_len; @@ -83,19 +83,20 @@ static long bytes_out = 0; static uch *output_data; static unsigned long output_ptr = 0; + 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 **); - -int puts(const char *); - + +static void puts(const char *); + extern int _text; /* Defined in vmlinux.lds.S */ extern int _end; static unsigned long free_mem_ptr; static unsigned long free_mem_end_ptr; - + #define HEAP_SIZE 0x10000 #include "../../../../lib/inflate.c" @@ -133,7 +134,7 @@ static void gzip_release(void **ptr) } #ifdef CONFIG_SH_STANDARD_BIOS -size_t strlen(const char *s) +static int strlen(const char *s) { int i = 0; @@ -142,17 +143,14 @@ size_t strlen(const char *s) return i; } -int puts(const char *s) +void puts(const char *s) { - int len = strlen(s); - sh_bios_console_write(s, len); - return len; + sh_bios_console_write(s, strlen(s)); } #else -int puts(const char *s) +void puts(const char *s) { - /* This should be updated to use the sh-sci routines */ - return 0; + /* This should be updated to use the sh-sci routines */ } #endif @@ -200,9 +198,9 @@ static void flush_window(void) ulg c = crc; /* temporary variable */ unsigned n; uch *in, *out, ch; - + in = window; - out = &output_data[output_ptr]; + out = &output_data[output_ptr]; for (n = 0; n < outcnt; n++) { ch = *out++ = *in++; c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);