From: Mike Frysinger Date: Fri, 15 Feb 2008 02:08:23 -0500 Subject: [U-Boot-Users] [PATCH] Add call command on PPC In-Reply-To: References: <200802150132.05249.vapier@gentoo.org> Message-ID: <200802150208.24076.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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