linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/20] inflate: refactor boot-time inflate code
@ 2005-12-22 18:26 Matt Mackall
  2005-12-22 18:26 ` [PATCH 1/20] inflate: lindent and manual formatting changes Matt Mackall
  2006-01-05  3:50 ` [PATCH 0/20] inflate: refactor boot-time inflate code Andrew Morton
  0 siblings, 2 replies; 24+ messages in thread
From: Matt Mackall @ 2005-12-22 18:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-arch, linux-tiny

This is a refactored version of the lib/inflate.c:

- clean up some really ugly code
- clean up atrocities like '#include "../../../lib/inflate.c"'
- drop a ton of cut and paste code from the kernel boot
- move towards making the boot decompressor pluggable
- move towards unifying the multiple inflate implementations
- save space

Recent changes include:

- use proper pointer types for minimal malloc arena
- fix up static const usage to make ARM happy
- fix compile with CONFIG_MODVERSIONS

This touches 11 architectures, which makes things slightly
interesting. Rather than break the patches out by arch, I've gone the
route of making a number of small incremental changes that sweep
across the tree. Patches that touch the per-arch code are marked
"(arch)".

I've been primarily testing this on x86, but various versions of this
code have gotten testing on a variety of architectures as part of my
linux-tiny tree.

(This work was sponsored in part by the CE Linux Forum.)

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCH 17/20] inflate: mark some arrays as initdata
@ 2005-10-31 20:54 Matt Mackall
  2005-10-31 20:54 ` [PATCH 18/20] inflate: minor const changes Matt Mackall
  0 siblings, 1 reply; 24+ messages in thread
From: Matt Mackall @ 2005-10-31 20:54 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel; +Cc: linux-arch

inflate: mark some arrays as INITDATA and define it in in-core callers

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: tiny/init/do_mounts_rd.c
===================================================================
--- tiny.orig/init/do_mounts_rd.c	2005-09-30 23:45:21.000000000 -0700
+++ tiny/init/do_mounts_rd.c	2005-09-30 23:45:37.000000000 -0700
@@ -271,6 +271,7 @@ int __init rd_load_disk(int n)
 
 /* gzip declarations */
 #define INIT __init
+#define INITDATA __initdata
 #define NO_INFLATE_MALLOC
 
 #include "../lib/inflate.c"
Index: tiny/lib/inflate.c
===================================================================
--- tiny.orig/lib/inflate.c	2005-09-30 23:45:33.000000000 -0700
+++ tiny/lib/inflate.c	2005-09-30 23:48:16.000000000 -0700
@@ -104,6 +104,9 @@
 #ifndef INIT
 #define INIT
 #endif
+#ifndef INITDATA
+#define INITDATA
+#endif
 
 #include <asm/types.h>
 
@@ -144,7 +147,7 @@ static void free(void *where)
 		malloc_ptr = free_mem_ptr;
 }
 
-static u8 window[0x8000]; /* use a statically allocated window */
+static u8 INITDATA window[0x8000]; /* use a statically allocated window */
 #else
 static u8 *window; /* dynamically allocate */
 #define malloc(a) kmalloc(a, GFP_KERNEL)
@@ -236,12 +239,12 @@ static void copy_bytes(struct iostate *i
 /* Tables for deflate from PKZIP's appnote.txt. */
 
 /* Order of the bit length code lengths */
-static const unsigned border[] = {
+static INITDATA unsigned border[] = {
 	16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
 };
 
 /* Copy lengths for literal codes 257..285 */
-static const u16 cplens[] = {
+static INITDATA u16 cplens[] = {
 	3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
 	35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
 };
@@ -250,20 +253,20 @@ static const u16 cplens[] = {
  * note: see note #13 above about the 258 in this list.
  * 99==invalid
  */
-static const u16 cplext[] = {
+static INITDATA u16 cplext[] = {
 	0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
 	3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99
 };
 
 /* Copy offsets for distance codes 0..29 */
-static const u16 cpdist[] = {
+static INITDATA u16 cpdist[] = {
 	1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
 	257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
 	8193, 12289, 16385, 24577
 };
 
 /* Extra bits for distance codes */
-static const u16 cpdext[] = {
+static INITDATA u16 cpdext[] = {
 	0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
 	7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
 	12, 12, 13, 13
Index: tiny/init/initramfs.c
===================================================================
--- tiny.orig/init/initramfs.c	2005-09-30 23:44:47.000000000 -0700
+++ tiny/init/initramfs.c	2005-09-30 23:46:20.000000000 -0700
@@ -332,6 +332,7 @@ static void __init flush_buffer(u8 *buf,
 /* gzip declarations */
 
 #define INIT __init
+#define INITDATA __initdata
 #define NO_INFLATE_MALLOC
 
 #include "../lib/inflate.c"

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2006-01-05  5:15 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-22 18:26 [PATCH 0/20] inflate: refactor boot-time inflate code Matt Mackall
2005-12-22 18:26 ` [PATCH 1/20] inflate: lindent and manual formatting changes Matt Mackall
2005-12-22 18:26   ` [PATCH 2/20] inflate: kill legacy bits Matt Mackall
2005-12-22 18:26     ` [PATCH 3/20] inflate: clean up input logic Matt Mackall
2005-12-22 18:26       ` [PATCH 4/20] inflate: start moving globals into iostate Matt Mackall
2005-12-22 18:26         ` [PATCH 5/20] inflate: cleanup Huffman table code Matt Mackall
2005-12-22 18:26           ` [PATCH 6/20] inflate: internalize CRC calculation, cleanup table calculation Matt Mackall
2005-12-22 18:26             ` [PATCH 7/20] inflate: eliminate memzero usage Matt Mackall
2005-12-22 18:26               ` [PATCH 8/20] inflate: (arch) kill unneeded declarations Matt Mackall
2005-12-22 18:26                 ` [PATCH 9/20] inflate: (arch) refactor inflate malloc code Matt Mackall
2005-12-22 18:26                   ` [PATCH 10/20] inflate: (arch) kill external CRC calculation Matt Mackall
2005-12-22 18:26                     ` [PATCH 11/20] inflate: (arch) kill get_byte Matt Mackall
2005-12-22 18:26                       ` [PATCH 12/20] inflate: internalize (arch) most of the output window handling Matt Mackall
2005-12-22 18:26                         ` [PATCH 13/20] inflate: (arch) kill silly zlib typedefs Matt Mackall
2005-12-22 18:26                           ` [PATCH 14/20] inflate: (arch) use an error callback rather than a global Matt Mackall
2005-12-22 18:26                             ` [PATCH 15/20] inflate: (arch) tidy user declarations Matt Mackall
2005-12-22 18:26                               ` [PATCH 16/20] inflate: remove legacy DEBG macros Matt Mackall
2005-12-22 18:26                                 ` [PATCH 17/20] inflate: mark some arrays as initdata Matt Mackall
2005-12-22 18:27                                   ` [PATCH 18/20] inflate: minor const changes Matt Mackall
2005-12-22 18:27                                     ` [PATCH 19/20] inflate: (arch) use proper linking Matt Mackall
2005-12-22 18:27                                       ` [PATCH 20/20] inflate: make in-core inflate share common CRC Matt Mackall
2006-01-05  3:50 ` [PATCH 0/20] inflate: refactor boot-time inflate code Andrew Morton
2006-01-05  5:09   ` Matt Mackall
  -- strict thread matches above, loose matches on Subject: below --
2005-10-31 20:54 [PATCH 17/20] inflate: mark some arrays as initdata Matt Mackall
2005-10-31 20:54 ` [PATCH 18/20] inflate: minor const changes Matt Mackall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).