From: Erik M. <er...@us...> - 2002-02-16 00:44:03
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv23847/include/blob Modified Files: Makefile.am compr_rubin.h load_kernel.h mini_inflate.h util.h Log Message: cramfs+JFFS2 cleanup part one (code size got almost 2K smaller) Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 12 Feb 2002 23:55:24 -0000 1.15 +++ Makefile.am 16 Feb 2002 00:43:59 -0000 1.16 @@ -18,6 +18,7 @@ arch.h \ command.h \ command_hist.h \ + compr_rubin.h \ crc32.h \ debug.h \ errno.h \ @@ -25,14 +26,17 @@ flash.h \ icache.h \ init.h \ + jffs2.h \ lcd.h \ led.h \ linux.h \ + load_kernel.h \ main.h \ md5.h \ md5support.h \ memory.h \ memsetup.h \ + mini_inflate.h \ param_block.h \ partition.h \ reboot.h \ Index: compr_rubin.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/compr_rubin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- compr_rubin.h 14 Feb 2002 09:59:34 -0000 1.1 +++ compr_rubin.h 16 Feb 2002 00:43:59 -0000 1.2 @@ -3,6 +3,11 @@ /* last modification : aug 15, 1994 */ /* $Id$ */ +#ident "$Id$" + +#ifndef BLOB_COMPR_RUBIN_H +#define BLOB_COMPR_RUBIN_H + #define RUBIN_REG_SIZE 16 #define UPPER_BIT_RUBIN (((long) 1)<<(RUBIN_REG_SIZE-1)) #define LOWER_BITS_RUBIN ((((long) 1)<<(RUBIN_REG_SIZE-1))-1) @@ -10,3 +15,5 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, unsigned long sourcelen, unsigned long dstlen); + +#endif Index: load_kernel.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/load_kernel.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- load_kernel.h 14 Feb 2002 10:17:59 -0000 1.2 +++ load_kernel.h 16 Feb 2002 00:43:59 -0000 1.3 @@ -23,6 +23,14 @@ * */ +#ident "$Id$" + +#ifndef BLOB_LOAD_KERNEL_H +#define BLOB_LOAD_KERNEL_H + +#include <blob/main.h> +#include <blob/types.h> + /* this struct is very similar to mtd_info */ struct part_info { u32 size; // Total size of the Partition @@ -64,12 +72,6 @@ /* the modules call this every 0x40000 bytes to update a progress bar */ inline void ldr_update_progress(void); -/* self explanitory */ -inline int ldr_strncmp(char *a, char *b, size_t n); -inline void *ldr_memcpy(void *dst, void *src, size_t n); - -/* the first one outputs a string to the serial port, the second a u32 hex # */ -inline void ldr_output_string(char *str); -inline void ldr_output_hex(u32 hex); - void load_kernel(blob_status_t *blob_status); + +#endif Index: mini_inflate.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/mini_inflate.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mini_inflate.h 14 Feb 2002 09:59:34 -0000 1.1 +++ mini_inflate.h 16 Feb 2002 00:43:59 -0000 1.2 @@ -22,61 +22,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ - -typedef __SIZE_TYPE__ size; - -#define NO_ERROR 0 -#define COMP_UNKNOWN 1 /* The specififed bytype is invalid */ -#define CODE_NOT_FOUND 2 /* a huffman code in the stream could not be decoded */ -#define TOO_MANY_BITS 3 /* pull_bits was passed an argument that is too - * large */ -/* This struct represents an entire huffman code set. It has various lookup - * tables to speed decoding */ -struct huffman_set { - int bits; /* maximum bit length */ - int num_symbols; /* Number of symbols this code can represent */ - int *lengths; /* The bit length of symbols */ - int *symbols; /* All of the symbols, sorted by the huffman code */ - int *count; /* the number of codes of this bit length */ - int *first; /* the first code of this bit length */ - int *pos; /* the symbol that first represents (in the symbols - * array) */ -}; +#ident "$Id$" -struct bitstream { - unsigned char *data; /* increments as we move from byte to byte */ - unsigned char bit; /* 0 to 7 */ - void *(*memcpy)(void *, void *, size); - unsigned long decoded; /* The number of bytes decoded */ - int error; +#ifndef BLOB_MINI_INFLATE_H +#define BLOB_MINI_INFLATE_H + - int distance_count[16]; - int distance_first[16]; - int distance_pos[16]; - int distance_lengths[32]; - int distance_symbols[32]; +long decompress_block(unsigned char *dest, unsigned char *source); - int code_count[8]; - int code_first[8]; - int code_pos[8]; - int code_lengths[19]; - int code_symbols[19]; - - int length_count[16]; - int length_first[16]; - int length_pos[16]; - int length_lengths[288]; - int length_symbols[288]; - - struct huffman_set codes; - struct huffman_set lengths; - struct huffman_set distance; -}; - -#define NO_COMP 0 -#define FIXED_COMP 1 -#define DYNAMIC_COMP 2 -long decompress_block(unsigned char *dest, unsigned char *source, - void *(*inflate_memcpy)(void *dest, void *src, size n)); +#endif Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- util.h 12 Feb 2002 23:59:41 -0000 1.9 +++ util.h 16 Feb 2002 00:43:59 -0000 1.10 @@ -42,6 +42,8 @@ void *memcpy(void *dest, const void *src, size_t n); +void *memset(void *dest, int c, size_t n); + int strncmp(const char *s1, const char *s2, size_t maxlen); int strlen(const char *s); |