[U-Boot-Users] [PATCH] Add call command on PPC

Mike Frysinger vapier at gentoo.org
Fri Feb 15 08:08:23 CET 2008


On Friday 15 February 2008, Kumar Gala wrote:
> On Feb 15, 2008, at 12:32 AM, Mike Frysinger wrote:
> > On Friday 15 February 2008, Kumar Gala wrote:
> >> On Feb 14, 2008, at 11:54 PM, Mike Frysinger wrote:
> >>> On Friday 15 February 2008, Kumar Gala wrote:
> >>>> --- /dev/null
> >>>> +++ b/lib_ppc/cmd_call.c
> >>>
> >>> there's nothing ppc specific about this
> >>
> >> I'm not familiar w/other architecture ABIs to say if that's true or
> >> not.  Clearly the upper limit may vary based on the differences in
> >> the
> >> ABIs.
> >
> > if the code were written in assembly, i'd agree.  you've written it
> > in pure C
> > though, so the compiler worries about the ABI.  if your ABI has
> > different
> > semantics for function pointers than normal function calls, it's a
> > piece of
> > crap.  i dont think any ports of u-boot need worry about this.
>
> agreed there.
>
> The main reason for me doing this was to provide a "generic" mechanism
> that mimic how we boot kernels on PPC.
>
> The other issue w/providing this on all arch's is that the number of
> params passed via regs may vary and I don't know what is for arm,
> avr32, blackfin, i386, m68k, microblaze, mips, nios, nios2, and sh.
>
> and each variation will require a different prototype.
>
> if someone can tell me what the number of args are for each arch we
> can see about providing this everywhere.

are you sure you actually need to worry about such things ?  i'm pretty sure 
any relevant architecture says that the first X arguments go via registers 
and the rest go on the stack.  let the compiler worry about the exact value 
for X.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080215/05dde53e/attachment.pgp 


More information about the U-Boot mailing list