linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* problems with powerpc-linux-gcc
@ 2000-12-13 14:23 Rabeeh Khoury
  2000-12-13 15:26 ` Wolfgang Denk
  2000-12-14  6:16 ` PCMCIA have machine check Nguyen Xuan Hoang
  0 siblings, 2 replies; 7+ messages in thread
From: Rabeeh Khoury @ 2000-12-13 14:23 UTC (permalink / raw)
  To: linuxppc-embedded


Hi All,

I'm having trouble with compiling some code that I will use for our
embedded system when booting the system.

The function that I'm having trouble with is the printf function. I used
this function in i386 and mips environement (cross compiling) and it
worked fine, the argumenents are forwarded to the function are put in
the stack and the printf fetches them and then displays the formatted
output.

In the powerpc environemnt (using GNU powerpc-linux-gcc cross compiler),
the compiler puts the arguments in registers instead of the stack ; due
to that the printf can only print the constant characters but the %d %x
etc can not print them right.

here is the code :


static char *do_printf(char *buf, const char *fmt, const int *dp)
{
   register char *p;
   char tmp[16];
...
...
...
}


void printf(const char *fmt, ...)
{
   char buf[256],*p;
   p = buf;
   do_printf(buf, fmt, ((const int *)&fmt)+1);
   while (*p) putchar(*p++);
}


The calling function -
for (temp = 0 ; temp < 15 ; temp ++) {
   printf ("???? %d\n",temp);
}

and the output is -
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184
???? 565184

and the disassembly of the calling function is -

  400000:       94 21 ff f0     stwu    r1,-16(r1)
  400004:       7c 08 02 a6     mflr    r0
  400008:       bf c1 00 08     stmw    r30,8(r1)
  40000c:       90 01 00 14     stw     r0,20(r1)
  400010:       3b e0 00 00     li      r31,0
  400014:       3f c0 00 41     lis     r30,65
  400018:       7f e4 fb 78     mr      r4,r31
  40001c:       38 7e fa 80     addi    r3,r30,-1408
  400020:       48 00 66 e5     bl      406704 <printf>
  400024:       3b ff 00 01     addi    r31,r31,1
  400028:       28 1f 00 0e     cmplwi  r31,14
  40002c:       40 81 ff ec     ble     400018 <boot_entry+0x18>






Thank you a milion -
Rabeeh


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: PCMCIA have machine check
@ 2000-12-16  5:07 Jerry Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Jerry Nguyen @ 2000-12-16  5:07 UTC (permalink / raw)
  To: linuxppc-embedded


 Hi ,

 Thank for all valuable advice. I have checked the
spec of Wireless LAN
 PCMCIA card, the wait signal is longer than the
setting of BMT. That
explain
 why we have the machine check.  My fix is modify the
the Machine Check
 Interrupt handler when read or write PCMCIA because
we still need monitor
 Machine check in some case and The driver work fine
now.

 Once again thank very much
 Jerry


> ----- Original Message -----
> From: <mlocke@jps.net>
> To: "Nguyen Xuan Hoang"
<jerry.nguyen@serialsystem.com.sg>
> Cc: <linuxppc-embedded@lists.linuxppc.org>;
<support@mvista.com>
> Sent: Wednesday, December 13, 2000 9:36 AM
> Subject: Re: PCMCIA have machine check
>
>
> >
> > You probably have the old RPX bootloader.  It sets
the Bus Montior
timeout
> > which causes machine checks for every IO
operation.  Contact EP tech
> support
> > and request PlanetCore, the new bootloader.
> > Nguyen Xuan Hoang wrote:
> >
> > > Hi,
> > >
> > > I am trying to run Wireless Lan PCMCIA on
RPXLite board,  but the
system
> > > just randomly crash (a machine check error).  I
have trace the error,
it
> > > happen when we read or write the I/O port on the
wireless LAN. It
seems
> the
> > > PCMCIA controller not set correctly. Have anyone
experience about this
> > > problem, please give me some advice.
> > >
> > > Thank in advance
> > > Jerry
> > >
> >
> >
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2000-12-16  5:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-13 14:23 problems with powerpc-linux-gcc Rabeeh Khoury
2000-12-13 15:26 ` Wolfgang Denk
2000-12-14  6:16 ` PCMCIA have machine check Nguyen Xuan Hoang
2000-12-13 17:15   ` clark
2000-12-13 17:36   ` mlocke
2000-12-13 17:37   ` mlocke
  -- strict thread matches above, loose matches on Subject: below --
2000-12-16  5:07 Jerry Nguyen

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).