public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix zlib debug in ppc boot header
@ 2004-07-28 11:22 Olaf Hering
  2004-07-28 11:34 ` Arjan van de Ven
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Olaf Hering @ 2004-07-28 11:22 UTC (permalink / raw)
  To: Andrew Morton, Tom Rini; +Cc: linux-kernel, linuxppc-dev


The ppc bootloader code will not compile with zlib debug enabled.
printf was not defined. Tested with vmlinux.coff
This patch was sent out earlier. Appearently it is not possible
to use the generic zlib copy in linux/lib

Signed-off-by: Olaf Hering <olh@suse.de>

diff -purN linux-2.6.8-rc2-bk6.orig/arch/ppc/boot/common/misc-common.c linux-2.6.8-rc2-bk6/arch/ppc/boot/common/misc-common.c
--- linux-2.6.8-rc2-bk6.orig/arch/ppc/boot/common/misc-common.c	2004-06-16 05:19:23.000000000 +0000
+++ linux-2.6.8-rc2-bk6/arch/ppc/boot/common/misc-common.c	2004-07-28 07:10:40.163537401 +0000
@@ -67,6 +67,17 @@ extern unsigned char serial_getc(unsigne
 extern void serial_putc(unsigned long com_port, unsigned char c);
 #endif
 
+int
+printf(char const *fmt, ...)
+{
+	va_list ap;
+
+	va_start(ap, fmt);
+	_vprintk(putc, fmt, ap);
+	va_end(ap);
+	return 0;
+}
+
 void pause(void)
 {
 	puts("pause\n");
diff -purN linux-2.6.8-rc2-bk6.orig/arch/ppc/boot/lib/zlib.c linux-2.6.8-rc2-bk6/arch/ppc/boot/lib/zlib.c
--- linux-2.6.8-rc2-bk6.orig/arch/ppc/boot/lib/zlib.c	2004-06-16 05:19:03.000000000 +0000
+++ linux-2.6.8-rc2-bk6/arch/ppc/boot/lib/zlib.c	2004-07-28 07:47:52.879321378 +0000
@@ -1,3 +1,7 @@
+#if 0
+#define DEBUG_ZLIB 1
+#define verbose 1
+#endif
 /*
  * 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
@@ -85,16 +89,16 @@ extern char *z_errmsg[]; /* indexed by 1
 
 /* Diagnostic functions */
 #ifdef DEBUG_ZLIB
-#  include <stdio.h>
+#  include <nonstdio.h>
 #  ifndef verbose
 #    define verbose 0
 #  endif
-#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
-#  define Trace(x) fprintf x
-#  define Tracev(x) {if (verbose) fprintf x ;}
-#  define Tracevv(x) {if (verbose>1) fprintf x ;}
-#  define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
-#  define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
+#  define Assert(cond,msg) {if(!(cond)) printf(msg);}
+#  define Trace(x) printf x
+#  define Tracev(x) {if (verbose) printf x ;}
+#  define Tracevv(x) {if (verbose>1) printf x ;}
+#  define Tracec(c,x) {if (verbose && (c)) printf x ;}
+#  define Tracecv(c,x) {if (verbose>1 && (c)) printf x ;}
 #else
 #  define Assert(cond,msg)
 #  define Trace(x)
@@ -311,7 +315,7 @@ int inflateReset(
   z->msg = Z_NULL;
   z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
   inflate_blocks_reset(z->state->blocks, z, &c);
-  Trace((stderr, "inflate: reset\n"));
+  Trace(("inflate: reset\n"));
   return Z_OK;
 }
 
@@ -328,7 +332,7 @@ int inflateEnd(
     inflate_blocks_free(z->state->blocks, z, &c);
   ZFREE(z, z->state, sizeof(struct internal_state));
   z->state = Z_NULL;
-  Trace((stderr, "inflate: end\n"));
+  Trace(("inflate: end\n"));
   return Z_OK;
 }
 
@@ -372,7 +376,7 @@ int inflateInit2(
     inflateEnd(z);
     return Z_MEM_ERROR;
   }
-  Trace((stderr, "inflate: allocated\n"));
+  Trace(("inflate: allocated\n"));
 
   /* reset state */
   inflateReset(z);
@@ -437,7 +441,7 @@ int inflate(
         z->state->sub.marker = 5;       /* can't try inflateSync */
         break;
       }
-      Trace((stderr, "inflate: zlib header ok\n"));
+      Trace(("inflate: zlib header ok\n"));
       z->state->mode = BLOCKS;
     case BLOCKS:
       r = inflate_blocks(z->state->blocks, z, r);
@@ -482,7 +486,7 @@ int inflate(
         z->state->sub.marker = 5;       /* can't try inflateSync */
         break;
       }
-      Trace((stderr, "inflate: zlib check ok\n"));
+      Trace(("inflate: zlib check ok\n"));
       z->state->mode = DONE;
     case DONE:
       return Z_STREAM_END;
@@ -766,7 +770,7 @@ local void inflate_blocks_reset(
   s->read = s->write = s->window;
   if (s->checkfn != Z_NULL)
     s->check = (*s->checkfn)(0L, Z_NULL, 0);
-  Trace((stderr, "inflate:   blocks reset\n"));
+  Trace(("inflate:   blocks reset\n"));
 }
 
 
@@ -789,7 +793,7 @@ local inflate_blocks_statef *inflate_blo
   s->end = s->window + w;
   s->checkfn = c;
   s->mode = TYPE;
-  Trace((stderr, "inflate:   blocks allocated\n"));
+  Trace(("inflate:   blocks allocated\n"));
   inflate_blocks_reset(s, z, &s->check);
   return s;
 }
@@ -822,7 +826,7 @@ local int inflate_blocks(
       switch (t >> 1)
       {
         case 0:                         /* stored */
-          Trace((stderr, "inflate:     stored block%s\n",
+          Trace(("inflate:     stored block%s\n",
                  s->last ? " (last)" : ""));
           DUMPBITS(3)
           t = k & 7;                    /* go to byte boundary */
@@ -830,7 +834,7 @@ local int inflate_blocks(
           s->mode = LENS;               /* get length of stored block */
           break;
         case 1:                         /* fixed */
-          Trace((stderr, "inflate:     fixed codes block%s\n",
+          Trace(("inflate:     fixed codes block%s\n",
                  s->last ? " (last)" : ""));
           {
             uInt bl, bd;
@@ -850,7 +854,7 @@ local int inflate_blocks(
           s->mode = CODES;
           break;
         case 2:                         /* dynamic */
-          Trace((stderr, "inflate:     dynamic codes block%s\n",
+          Trace(("inflate:     dynamic codes block%s\n",
                  s->last ? " (last)" : ""));
           DUMPBITS(3)
           s->mode = TABLE;
@@ -874,7 +878,7 @@ local int inflate_blocks(
       }
       s->sub.left = (uInt)b & 0xffff;
       b = k = 0;                      /* dump bits */
-      Tracev((stderr, "inflate:       stored length %u\n", s->sub.left));
+      Tracev(("inflate:       stored length %u\n", s->sub.left));
       s->mode = s->sub.left ? STORED : TYPE;
       break;
     case STORED:
@@ -889,7 +893,7 @@ local int inflate_blocks(
       q += t;  m -= t;
       if ((s->sub.left -= t) != 0)
         break;
-      Tracev((stderr, "inflate:       stored end, %lu total out\n",
+      Tracev(("inflate:       stored end, %lu total out\n",
               z->total_out + (q >= s->read ? q - s->read :
               (s->end - s->read) + (q - s->window))));
       s->mode = s->last ? DRY : TYPE;
@@ -917,7 +921,7 @@ local int inflate_blocks(
       s->sub.trees.nblens = t;
       DUMPBITS(14)
       s->sub.trees.index = 0;
-      Tracev((stderr, "inflate:       table sizes ok\n"));
+      Tracev(("inflate:       table sizes ok\n"));
       s->mode = BTREE;
     case BTREE:
       while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
@@ -939,7 +943,7 @@ local int inflate_blocks(
         LEAVE
       }
       s->sub.trees.index = 0;
-      Tracev((stderr, "inflate:       bits tree ok\n"));
+      Tracev(("inflate:       bits tree ok\n"));
       s->mode = DTREE;
     case DTREE:
       while (t = s->sub.trees.table,
@@ -1002,7 +1006,7 @@ local int inflate_blocks(
           r = t;
           LEAVE
         }
-        Tracev((stderr, "inflate:       trees ok\n"));
+        Tracev(("inflate:       trees ok\n"));
         if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
         {
           inflate_trees_free(td, z);
@@ -1025,7 +1029,7 @@ local int inflate_blocks(
       inflate_trees_free(s->sub.decode.td, z);
       inflate_trees_free(s->sub.decode.tl, z);
       LOAD
-      Tracev((stderr, "inflate:       codes end, %lu total out\n",
+      Tracev(("inflate:       codes end, %lu total out\n",
               z->total_out + (q >= s->read ? q - s->read :
               (s->end - s->read) + (q - s->window))));
       if (!s->last)
@@ -1068,7 +1072,7 @@ local int inflate_blocks_free(
   inflate_blocks_reset(s, z, c);
   ZFREE(z, s->window, s->end - s->window);
   ZFREE(z, s, sizeof(struct inflate_blocks_state));
-  Trace((stderr, "inflate:   blocks freed\n"));
+  Trace(("inflate:   blocks freed\n"));
   return Z_OK;
 }
 
@@ -1230,7 +1234,7 @@ local uInt cpdext[] = { /* Extra bits fo
 #define N_MAX 288       /* maximum number of codes in any set */
 
 #ifdef DEBUG_ZLIB
-  uInt inflate_hufts;
+  local uInt inflate_hufts;
 #endif
 
 local int huft_build(
@@ -1687,7 +1691,7 @@ local inflate_codes_statef *inflate_code
     c->dbits = (Byte)bd;
     c->ltree = tl;
     c->dtree = td;
-    Tracev((stderr, "inflate:       codes new\n"));
+    Tracev(("inflate:       codes new\n"));
   }
   return c;
 }
@@ -1743,7 +1747,7 @@ local int inflate_codes(
       if (e == 0)               /* literal */
       {
         c->sub.lit = t->base;
-        Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+        Tracevv((t->base >= 0x20 && t->base < 0x7f ?
                  "inflate:         literal '%c'\n" :
                  "inflate:         literal 0x%02x\n", t->base));
         c->mode = LIT;
@@ -1764,7 +1768,7 @@ local int inflate_codes(
       }
       if (e & 32)               /* end of block */
       {
-        Tracevv((stderr, "inflate:         end of block\n"));
+        Tracevv(("inflate:         end of block\n"));
         c->mode = WASH;
         break;
       }
@@ -1779,7 +1783,7 @@ local int inflate_codes(
       DUMPBITS(j)
       c->sub.code.need = c->dbits;
       c->sub.code.tree = c->dtree;
-      Tracevv((stderr, "inflate:         length %u\n", c->len));
+      Tracevv(("inflate:         length %u\n", c->len));
       c->mode = DIST;
     case DIST:          /* i: get distance next */
       j = c->sub.code.need;
@@ -1809,7 +1813,7 @@ local int inflate_codes(
       NEEDBITS(j)
       c->sub.copy.dist += (uInt)b & inflate_mask[j];
       DUMPBITS(j)
-      Tracevv((stderr, "inflate:         distance %u\n", c->sub.copy.dist));
+      Tracevv(("inflate:         distance %u\n", c->sub.copy.dist));
       c->mode = COPY;
     case COPY:          /* o: copying bytes in window, waiting for space */
 #ifndef __TURBOC__ /* Turbo C bug for following expression */
@@ -1860,7 +1864,7 @@ local void inflate_codes_free(
 )
 {
   ZFREE(z, c, sizeof(struct inflate_codes_state));
-  Tracev((stderr, "inflate:       codes free\n"));
+  Tracev(("inflate:       codes free\n"));
 }
 
 /*+++++*/
@@ -1995,7 +1999,7 @@ local int inflate_fast(
     if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
     {
       DUMPBITS(t->bits)
-      Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+      Tracevv((t->base >= 0x20 && t->base < 0x7f ?
                 "inflate:         * literal '%c'\n" :
                 "inflate:         * literal 0x%02x\n", t->base));
       *q++ = (Byte)t->base;
@@ -2010,7 +2014,7 @@ local int inflate_fast(
         e &= 15;
         c = t->base + ((uInt)b & inflate_mask[e]);
         DUMPBITS(e)
-        Tracevv((stderr, "inflate:         * length %u\n", c));
+        Tracevv(("inflate:         * length %u\n", c));
 
         /* decode distance base of block to copy */
         GRABBITS(15);           /* max bits for distance code */
@@ -2024,7 +2028,7 @@ local int inflate_fast(
             GRABBITS(e)         /* get extra bits (up to 13) */
             d = t->base + ((uInt)b & inflate_mask[e]);
             DUMPBITS(e)
-            Tracevv((stderr, "inflate:         * distance %u\n", d));
+            Tracevv(("inflate:         * distance %u\n", d));
 
             /* do the copy */
             m -= c;
@@ -2069,7 +2073,7 @@ local int inflate_fast(
         if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)
         {
           DUMPBITS(t->bits)
-          Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+          Tracevv((t->base >= 0x20 && t->base < 0x7f ?
                     "inflate:         * literal '%c'\n" :
                     "inflate:         * literal 0x%02x\n", t->base));
           *q++ = (Byte)t->base;
@@ -2079,7 +2083,7 @@ local int inflate_fast(
       }
       else if (e & 32)
       {
-        Tracevv((stderr, "inflate:         * end of block\n"));
+        Tracevv(("inflate:         * end of block\n"));
         UNGRAB
         UPDATE
         return Z_STREAM_END;
-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 11:22 [PATCH] fix zlib debug in ppc boot header Olaf Hering
@ 2004-07-28 11:34 ` Arjan van de Ven
  2004-07-28 15:01   ` Tom Rini
  2004-07-28 15:18 ` Geert Uytterhoeven
  2004-07-28 15:29 ` Tom Rini
  2 siblings, 1 reply; 13+ messages in thread
From: Arjan van de Ven @ 2004-07-28 11:34 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Andrew Morton, Tom Rini, linux-kernel, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

On Wed, 2004-07-28 at 13:22, Olaf Hering wrote:
> The ppc bootloader code will not compile with zlib debug enabled.
> printf was not defined. Tested with vmlinux.coff
> This patch was sent out earlier. Appearently it is not possible
> to use the generic zlib copy in linux/lib

actually it should be possible. Ok so it needs to be compiled as 32 bit,
but surely just #include-ing the /linux/lib version, or even better, a
few Makefile tricks should allow that, right ?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 11:34 ` Arjan van de Ven
@ 2004-07-28 15:01   ` Tom Rini
  2004-07-28 15:36     ` Olaf Hering
  0 siblings, 1 reply; 13+ messages in thread
From: Tom Rini @ 2004-07-28 15:01 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Olaf Hering, Andrew Morton, linux-kernel, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

On Wed, Jul 28, 2004 at 01:34:55PM +0200, Arjan van de Ven wrote:

> On Wed, 2004-07-28 at 13:22, Olaf Hering wrote:
> > The ppc bootloader code will not compile with zlib debug enabled.
> > printf was not defined. Tested with vmlinux.coff
> > This patch was sent out earlier. Appearently it is not possible
> > to use the generic zlib copy in linux/lib
> 
> actually it should be possible. Ok so it needs to be compiled as 32 bit,
> but surely just #include-ing the /linux/lib version, or even better, a
> few Makefile tricks should allow that, right ?

Arjan is correct, it should be very possible to use the copy in
lib/zlib_deflate as mpm had patches at one point to do just this.

Further, I'd rather leave the zlib debug stuff as is in arch/ppc/boot.
Olaf, has having this code work for you ever been useful?  Thanks.

-- 
Tom Rini
http://gate.crashing.org/~trini/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 11:22 [PATCH] fix zlib debug in ppc boot header Olaf Hering
  2004-07-28 11:34 ` Arjan van de Ven
@ 2004-07-28 15:18 ` Geert Uytterhoeven
  2004-07-28 15:29 ` Tom Rini
  2 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2004-07-28 15:18 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Andrew Morton, Tom Rini, Linux Kernel Development,
	Linux/PPC Development

On Wed, 28 Jul 2004, Olaf Hering wrote:
> @@ -85,16 +89,16 @@ extern char *z_errmsg[]; /* indexed by 1
>
>  /* Diagnostic functions */
>  #ifdef DEBUG_ZLIB
> -#  include <stdio.h>
> +#  include <nonstdio.h>
>  #  ifndef verbose
>  #    define verbose 0
>  #  endif
> -#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
> -#  define Trace(x) fprintf x
> -#  define Tracev(x) {if (verbose) fprintf x ;}
> -#  define Tracevv(x) {if (verbose>1) fprintf x ;}
> -#  define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
> -#  define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
> +#  define Assert(cond,msg) {if(!(cond)) printf(msg);}
> +#  define Trace(x) printf x
> +#  define Tracev(x) {if (verbose) printf x ;}
> +#  define Tracevv(x) {if (verbose>1) printf x ;}
> +#  define Tracec(c,x) {if (verbose && (c)) printf x ;}
> +#  define Tracecv(c,x) {if (verbose>1 && (c)) printf x ;}
>  #else
>  #  define Assert(cond,msg)
>  #  define Trace(x)
> @@ -311,7 +315,7 @@ int inflateReset(
>    z->msg = Z_NULL;
>    z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
>    inflate_blocks_reset(z->state->blocks, z, &c);
> -  Trace((stderr, "inflate: reset\n"));
> +  Trace(("inflate: reset\n"));
>    return Z_OK;
>  }
>

Why don't you just define a fprintf() that throws away its first argument and
calls printf(), so you don't need to modify every caller of Trace*()?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 11:22 [PATCH] fix zlib debug in ppc boot header Olaf Hering
  2004-07-28 11:34 ` Arjan van de Ven
  2004-07-28 15:18 ` Geert Uytterhoeven
@ 2004-07-28 15:29 ` Tom Rini
  2004-07-28 17:42   ` Sam Ravnborg
  2 siblings, 1 reply; 13+ messages in thread
From: Tom Rini @ 2004-07-28 15:29 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Andrew Morton, linux-kernel, linuxppc-dev

On Wed, Jul 28, 2004 at 01:22:22PM +0200, Olaf Hering wrote:

> The ppc bootloader code will not compile with zlib debug enabled.
> printf was not defined. Tested with vmlinux.coff
> This patch was sent out earlier. Appearently it is not possible
> to use the generic zlib copy in linux/lib
> 
> Signed-off-by: Olaf Hering <olh@suse.de>

Again, I do not want to see this.  First, have you run into an occasion
where this was needed and helpful?  Second, I would much rather see
someone just rip out zlib.c and replace it with lib/zlib_deflate than to
try and modify the code again.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 15:01   ` Tom Rini
@ 2004-07-28 15:36     ` Olaf Hering
  2004-07-28 23:06       ` Tom Rini
  0 siblings, 1 reply; 13+ messages in thread
From: Olaf Hering @ 2004-07-28 15:36 UTC (permalink / raw)
  To: Tom Rini; +Cc: Arjan van de Ven, Andrew Morton, linux-kernel, linuxppc-dev

 On Wed, Jul 28, Tom Rini wrote:

> Olaf, has having this code work for you ever been useful?  Thanks.

The debug stuff? Sure. Now I know we have to improve the memcpy
alignment handling. But thats a different story.

-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 17:42   ` Sam Ravnborg
@ 2004-07-28 15:56     ` Tom Rini
  2004-07-28 18:18       ` Sam Ravnborg
  0 siblings, 1 reply; 13+ messages in thread
From: Tom Rini @ 2004-07-28 15:56 UTC (permalink / raw)
  To: Olaf Hering, Andrew Morton, linux-kernel, linuxppc-dev

On Wed, Jul 28, 2004 at 07:42:13PM +0200, Sam Ravnborg wrote:

> On Wed, Jul 28, 2004 at 08:29:40AM -0700, Tom Rini wrote:
> > On Wed, Jul 28, 2004 at 01:22:22PM +0200, Olaf Hering wrote:
> > 
> > > The ppc bootloader code will not compile with zlib debug enabled.
> > > printf was not defined. Tested with vmlinux.coff
> > > This patch was sent out earlier. Appearently it is not possible
> > > to use the generic zlib copy in linux/lib
> > > 
> > > Signed-off-by: Olaf Hering <olh@suse.de>
> > 
> > Again, I do not want to see this.  First, have you run into an occasion
> > where this was needed and helpful?  Second, I would much rather see
> > someone just rip out zlib.c and replace it with lib/zlib_deflate than to
> > try and modify the code again.
> 
> It should be possible just to include the zlib_deflate.o file from lib/.
> At least oprofile plays suchs ugly tricks.

Can you think of a cleaner way to do this?

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 18:18       ` Sam Ravnborg
@ 2004-07-28 16:39         ` Tom Rini
  2004-07-28 16:47           ` Jörn Engel
  0 siblings, 1 reply; 13+ messages in thread
From: Tom Rini @ 2004-07-28 16:39 UTC (permalink / raw)
  To: Olaf Hering, Andrew Morton, linux-kernel, linuxppc-dev

On Wed, Jul 28, 2004 at 08:18:17PM +0200, Sam Ravnborg wrote:

> On Wed, Jul 28, 2004 at 08:56:43AM -0700, Tom Rini wrote:
> > > 
> > > It should be possible just to include the zlib_deflate.o file from lib/.
> > > At least oprofile plays suchs ugly tricks.
> > 
> > Can you think of a cleaner way to do this?
> No, otherwise I would have changed oprofile also.

And, er, too early but I of course ment zlib_inflate, since we have the
compressed image we need to uncompress..

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 16:39         ` Tom Rini
@ 2004-07-28 16:47           ` Jörn Engel
  0 siblings, 0 replies; 13+ messages in thread
From: Jörn Engel @ 2004-07-28 16:47 UTC (permalink / raw)
  To: Tom Rini; +Cc: Olaf Hering, Andrew Morton, linux-kernel, linuxppc-dev

On Wed, 28 July 2004 09:39:14 -0700, Tom Rini wrote:
> 
> And, er, too early but I of course ment zlib_inflate, since we have the
> compressed image we need to uncompress..

If that works out, we should be able to kill lib/inflate.c as well.
That code is hopelessly outdated, has known bugs, etc.

Jörn

-- 
Sometimes, asking the right question is already the answer.
-- Unknown

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 15:29 ` Tom Rini
@ 2004-07-28 17:42   ` Sam Ravnborg
  2004-07-28 15:56     ` Tom Rini
  0 siblings, 1 reply; 13+ messages in thread
From: Sam Ravnborg @ 2004-07-28 17:42 UTC (permalink / raw)
  To: Tom Rini; +Cc: Olaf Hering, Andrew Morton, linux-kernel, linuxppc-dev

On Wed, Jul 28, 2004 at 08:29:40AM -0700, Tom Rini wrote:
> On Wed, Jul 28, 2004 at 01:22:22PM +0200, Olaf Hering wrote:
> 
> > The ppc bootloader code will not compile with zlib debug enabled.
> > printf was not defined. Tested with vmlinux.coff
> > This patch was sent out earlier. Appearently it is not possible
> > to use the generic zlib copy in linux/lib
> > 
> > Signed-off-by: Olaf Hering <olh@suse.de>
> 
> Again, I do not want to see this.  First, have you run into an occasion
> where this was needed and helpful?  Second, I would much rather see
> someone just rip out zlib.c and replace it with lib/zlib_deflate than to
> try and modify the code again.

It should be possible just to include the zlib_deflate.o file from lib/.
At least oprofile plays suchs ugly tricks.

	Sam

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 15:56     ` Tom Rini
@ 2004-07-28 18:18       ` Sam Ravnborg
  2004-07-28 16:39         ` Tom Rini
  0 siblings, 1 reply; 13+ messages in thread
From: Sam Ravnborg @ 2004-07-28 18:18 UTC (permalink / raw)
  To: Tom Rini; +Cc: Olaf Hering, Andrew Morton, linux-kernel, linuxppc-dev

On Wed, Jul 28, 2004 at 08:56:43AM -0700, Tom Rini wrote:
> > 
> > It should be possible just to include the zlib_deflate.o file from lib/.
> > At least oprofile plays suchs ugly tricks.
> 
> Can you think of a cleaner way to do this?
No, otherwise I would have changed oprofile also.

I have not tried it out on ppc/boot stuff, but I so no reason
why it should not work out.

	Sam

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 15:36     ` Olaf Hering
@ 2004-07-28 23:06       ` Tom Rini
  2004-07-29  6:48         ` Olaf Hering
  0 siblings, 1 reply; 13+ messages in thread
From: Tom Rini @ 2004-07-28 23:06 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Arjan van de Ven, Andrew Morton, linux-kernel, linuxppc-dev

On Wed, Jul 28, 2004 at 05:36:33PM +0200, Olaf Hering wrote:

> 
>  On Wed, Jul 28, Tom Rini wrote:
> 
> > Olaf, has having this code work for you ever been useful?  Thanks.
> 
> The debug stuff? Sure. Now I know we have to improve the memcpy
> alignment handling. But thats a different story.

Can you please elaborate?  Thanks.

-- 
Tom Rini
http://gate.crashing.org/~trini/

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

* Re: [PATCH] fix zlib debug in ppc boot header
  2004-07-28 23:06       ` Tom Rini
@ 2004-07-29  6:48         ` Olaf Hering
  0 siblings, 0 replies; 13+ messages in thread
From: Olaf Hering @ 2004-07-29  6:48 UTC (permalink / raw)
  To: Tom Rini; +Cc: Arjan van de Ven, Andrew Morton, linux-kernel, linuxppc-dev

 On Wed, Jul 28, Tom Rini wrote:

> On Wed, Jul 28, 2004 at 05:36:33PM +0200, Olaf Hering wrote:
> 
> > 
> >  On Wed, Jul 28, Tom Rini wrote:
> > 
> > > Olaf, has having this code work for you ever been useful?  Thanks.
> > 
> > The debug stuff? Sure. Now I know we have to improve the memcpy
> > alignment handling. But thats a different story.
> 
> Can you please elaborate?  Thanks.

ppc 601 barfs on unaligned string instructions. we can handle the
exceptions when the kernel runs, but not when OF is still in charge.


-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

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

end of thread, other threads:[~2004-07-29  6:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-28 11:22 [PATCH] fix zlib debug in ppc boot header Olaf Hering
2004-07-28 11:34 ` Arjan van de Ven
2004-07-28 15:01   ` Tom Rini
2004-07-28 15:36     ` Olaf Hering
2004-07-28 23:06       ` Tom Rini
2004-07-29  6:48         ` Olaf Hering
2004-07-28 15:18 ` Geert Uytterhoeven
2004-07-28 15:29 ` Tom Rini
2004-07-28 17:42   ` Sam Ravnborg
2004-07-28 15:56     ` Tom Rini
2004-07-28 18:18       ` Sam Ravnborg
2004-07-28 16:39         ` Tom Rini
2004-07-28 16:47           ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox