[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help with powerpc asm (moving grub_ieee1275_entry_fn initialization
Re: help with powerpc asm (moving grub_ieee1275_entry_fn initialization to crt0.S)
Thu, 17 Jan 2008 13:17:59 +0100
On Thu, Jan 17, 2008 at 02:54:33AM -0500, Pavel Roskin wrote:
> Quoting Robert Millan <address@hidden>:
> >Here's an incomplete (missing powerpc & sparc) version of the patch that
> >would sanitize this function call.
> I don't see why it needs to be done across the board. Maybe you have
> further simplifications in mind?
What do you mean? The problem I find is that forcing this to be the third
parameter of cmain makes it look like cmain has been adapted to accomodate
for this particular cpu.
Another option would be to have just one param. This would be the cleanest
on i386, since the call from OFW already uses -mregparm=1 for the callback
address, but I don't know about powerpc.
> By the way, please don't remove the declaration of cmain(). It may be
> useful to prevent a gcc warning (missing declaration). cmain() is
> really an rare case that doesn't need a declaration, since it's not
> called by any C code, but gcc doesn't know that.
Ah yes. Right.
> --- a/kern/powerpc/ieee1275/crt0.S
> +++ b/kern/powerpc/ieee1275/crt0.S
> @@ -38,5 +38,9 @@ _start:
> 2: stwu 2, 4(6) /* We know r2 is already 0 from above. */
> bdnz 2b
> + /* Store r5 in grub_ieee1275_entry_fn */
> + lis 9, address@hidden
> + stw 5, address@hidden(9)
I thought you'd also need to remove stuff. Isn't there code above this that
pushes the 3 parameters onto the stack?
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)