fix zlib debug in ppc boot header
PATCH 1/1 fix zlib debug in ppc boot header
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
arch/ppc/boot/common/misc-common.c +11 -0
@@ -67,6 +67,17 @@ extern unsigned char serial_getc(unsigneextern 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" );
arch/ppc/boot/lib/zlib.c +40 -36
262 lines not on this page · raw message
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 4 lines · Olaf Hering
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 ?
Quoted 9 lines · Arjan van de Ven
Quoted 4 lines · Olaf Hering
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/libactually 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
Makefiletricks 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.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 1 line · Tom Rini
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.
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 7 lines · Olaf Hering
Quoted 1 line · Tom Rini
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.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 11 lines · Tom Rini
Quoted 7 lines · Olaf Hering
Quoted 1 line · Tom Rini
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.
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 25 lines · Olaf Hering
arch/ppc/boot/lib/zlib.c +7
-7@@ -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)
arch/ppc/boot/lib/zlib.c int inflateReset( · line 321
Quoted 8 lines
arch/ppc/boot/lib/zlib.c +1
-1@@ -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 -- [email protected]
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
Quoted 6 lines · Olaf Hering
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/libSigned-off-by Olaf Hering <[email protected]>
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.
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 7 lines · Tom Rini
Quoted 5 lines · Olaf Hering
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
Quoted 6 lines
Quoted 1 line
Signed-off-by Olaf Hering <[email protected]>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.cand replace it withlib/zlib_deflatethan 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
Quoted 10 lines · Sam Ravnborg
Quoted 9 lines · Tom Rini
Quoted 6 lines · Olaf Hering
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/libSigned-off-by Olaf Hering <[email protected]>
Quoted 7 lines
Quoted 4 lines
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.cand replace it withlib/zlib_deflatethan 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?
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 5 lines · Tom Rini
Quoted 3 lines
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
Quoted 7 lines · Sam Ravnborg
Quoted 5 lines · Tom Rini
Quoted 3 lines
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..
Signature · 2 lines
Tom Rini http://gate.crashing.org/~trini/
Quoted 3 lines · Tom Rini
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
Signature · 2 lines
Sometimes, asking the right question is already the answer. -- Unknown