PowerPC changes provided by Pavel Roskin. * kern/powerpc/ieee1275/cmain.c (cmain): Don't take any arguments. * kern/powerpc/ieee1275/crt0.S: Store r5 in grub_ieee1275_entry_fn, don't rely on cmain() doing it. * kern/i386/ieee1275/startup.S (_start): Store %eax in grub_ieee1275_entry_fn, don't rely on cmain() doing it. diff -ur grub2/kern/i386/ieee1275/startup.S cmain/kern/i386/ieee1275/startup.S --- grub2/kern/i386/ieee1275/startup.S 2008-01-15 21:05:44.000000000 +0100 +++ cmain/kern/i386/ieee1275/startup.S 2008-01-17 20:05:51.000000000 +0100 @@ -34,5 +34,5 @@ start: _start: - movl %eax, %ecx + movl %eax, EXT_C(grub_ieee1275_entry_fn) jmp EXT_C(cmain) diff -ur grub2/kern/powerpc/ieee1275/cmain.c cmain/kern/powerpc/ieee1275/cmain.c --- grub2/kern/powerpc/ieee1275/cmain.c 2008-01-15 17:14:32.000000000 +0100 +++ cmain/kern/powerpc/ieee1275/cmain.c 2008-01-17 20:05:11.000000000 +0100 @@ -1,7 +1,7 @@ /* cmain.c - Startup code for the PowerPC. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,12 +102,10 @@ } } -void cmain (uint32_t r3, uint32_t r4, uint32_t r5); +void cmain (void); void -cmain (UNUSED uint32_t r3, UNUSED uint32_t r4, uint32_t r5) +cmain (void) { - grub_ieee1275_entry_fn = (int (*)(void *)) r5; - grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); grub_ieee1275_find_options (); diff -ur grub2/kern/powerpc/ieee1275/crt0.S cmain/kern/powerpc/ieee1275/crt0.S --- grub2/kern/powerpc/ieee1275/crt0.S 2007-07-22 01:32:27.000000000 +0200 +++ cmain/kern/powerpc/ieee1275/crt0.S 2008-01-17 20:05:04.000000000 +0100 @@ -1,7 +1,7 @@ /* crt0.S - Startup code for the PowerPC. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,5 +38,9 @@ 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) + bl cmain 1: b 1b