On Thu, Jan 17, 2008 at 02:54:33AM -0500, Pavel Roskin wrote:
> Quoting Robert Millan <[EMAIL PROTECTED]>:
> 
> >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, [EMAIL PROTECTED]
> +     stw     5, [EMAIL PROTECTED](9)

I thought you'd also need to remove stuff.  Isn't there code above this that
pushes the 3 parameters onto the stack?

-- 
Robert Millan

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


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to