Using newlib (was: [Efi332] Building newlib/libgloss for MPC555)
David Eicher
sailors3
Thu Aug 18 03:48:31 UTC 2005
Hi Gunter,
New info, I discovered that CHECK_INIT(fp) is called in vfprintf_r so it is
getting executed a different way than I thought. The bad news, running it
did NOT result in executing __sinit( ). I believe it is because it got a bad
pointer or argument from localeconv( ).
So., my current theory is that the problem with with the locale
setup/configure. For whatever reason, localeconv is not return a valid
argument, I'll have to check on why tomorrow night.
Thanks,
Dave
-----Original Message-----
From: efi332-bounces at diy-efi.org [mailto:efi332-bounces at diy-efi.org] On
Behalf Of Gunter Magin
Sent: Tuesday, August 16, 2005 11:48 AM
To: efi332 at diy-efi.org
Subject: Re: Using newlib (was: [Efi332] Building newlib/libgloss for
MPC555)
Hi David,
(have been out all day...)
On Mon, Aug 15, 2005 at 08:13:59PM -0700, David Eicher wrote:
> Making some progress. I've discovered that the __sfvwrite ( ) function
> accepts as input two parameters (fp and uio) as shown in this code
snippet.
>
> _DEFUN(__sfvwrite, (fp, uio),
> register FILE *fp _AND
> register struct __suio *uio)
>
> It appears in the code that one of the parameters is passed to the
function
> in register r3, which gets copied to r27. I put a breakpoint at the
> beginning of __sfvwrite (which is in file fvwrite.c) and discovered that
r3
> is 0xFFFFFFFF at the beginning of execution.
It is fp which has the wrong value.
Did you initialize in any way stdin/stdout?
No, I don't know precisely how to do that, but plain printf() expands
the call to vfprintf (_stdout_r (_REENT), fmt, ap);
So it has to do with _stdout_r, which actually is a macro defined in
newlib-1.13.0/newlib/libc/include/stdio.h
It uses a parameter _REENT, but I haven't found out where this is
defined, and where and how it is initialized. I strongly guess this is
the key for getting further.
It can be as easy, as the implicit fopen() call for stdout is missing,
but it also can be more. I have to bail out here.
> So..., that is more background on why __sfvwrite is crashing. I have not
> been able to tell which parameter is passed in r3 yet (working on it).
See above. Parameter passing is part of the PowerPC-EABI specification.
I think I have that in form of a .pdf from some IBM website, I forgot. But
it is not essential at this point.
gm
_______________________________________________
Efi332 mailing list
Efi332 at diy-efi.org
http://lists.diy-efi.org/mailman/listinfo/efi332
More information about the Efi332
mailing list