From: Pete P. <pp...@us...> - 2001-10-10 17:46:59
|
Update of /cvsroot/linux-mips/linux/arch/mips/zboot/lib In directory usw-pr-cvs1:/tmp/cvs-serv26774/arch/mips/zboot/lib Added Files: Makefile zlib.c Log Message: Alchemy PB1000 zImage support. Most of this work is portable to other embedded mips boards. The board specific code is in the pb1000 directory and it's just head.S and the Makefile and linker script. The common code was ported with very few modifications from the PPC boot code. --- NEW FILE: Makefile --- # # Makefile for some libs needed by zImage. # L_TARGET := zlib.a obj-y := zlib.o include $(TOPDIR)/Rules.make --- NEW FILE: zlib.c --- /* * This file is derived from various .h and .c files from the zlib-0.95 * distribution by Jean-loup Gailly and Mark Adler, with some additions * by Paul Mackerras to aid in implementing Deflate compression and * decompression for PPP packets. See zlib.h for conditions of * distribution and use. * * Changes that have been made include: * - changed functions not used outside this file to "local" * - added minCompression parameter to deflateInit2 * - added Z_PACKET_FLUSH (see zlib.h for details) * - added inflateIncomp * * $Id: zlib.c,v 1.1 2001/10/10 17:46:56 ppopov Exp $ */ /*+++++*/ /* zutil.h -- internal interface and configuration of the compression library * Copyright (C) 1995 Jean-loup Gailly. [...2109 lines suppressed...] unsigned long s2 = (adler >> 16) & 0xffff; int k; if (buf == Z_NULL) return 1L; while (len > 0) { k = len < NMAX ? len : NMAX; len -= k; while (k >= 16) { DO16(buf); k -= 16; } if (k != 0) do { DO1(buf); } while (--k); s1 %= BASE; s2 %= BASE; } return (s2 << 16) | s1; } |