Bean confirmed it works. Committed without changing jmp to call, since it wasn't clear whether we want it or not.
On Fri, Apr 18, 2008 at 01:32:59PM +0200, Robert Millan wrote: > On Thu, Apr 17, 2008 at 10:21:14PM -0400, Pavel Roskin wrote: > > Quoting Robert Millan <[EMAIL PROTECTED]>: > > > > >Now that I think of it, is there any reason for doing all the cmain() > > >cruft before grub_main() ? Getting to grub_main() only requires a working > > >stack, which we have, and grub_main() inmediately returns control back to > > >architecture-specific code in grub_machine_init(). > > > > > >So why not move from: > > > > > > _start -> cmain -> grub_main > > > > > >to: > > > > > > _start -> grub_main -> grub_machine_init -> cmain > > > > > >? > > > > I think it would be great. We should try to make the code for > > different architectures more uniform to simplify maintenance. > > Here. Unfortunately I can't test it as I have no ieee1275 at hand currently. > > Anyone? > > -- > 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 /.) > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp > ../grub2/include/grub/ieee1275/ieee1275.h ./include/grub/ieee1275/ieee1275.h > --- ../grub2/include/grub/ieee1275/ieee1275.h 2008-01-24 09:21:43.000000000 > +0100 > +++ ./include/grub/ieee1275/ieee1275.h 2008-04-18 13:31:27.000000000 > +0200 > @@ -97,6 +97,7 @@ extern void EXPORT_FUNC(grub_ieee1275_se > > > > +void EXPORT_FUNC(grub_ieee1275_init) (void); > int EXPORT_FUNC(grub_ieee1275_finddevice) (char *name, > grub_ieee1275_phandle_t *phandlep); > int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t phandle, > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp > ../grub2/kern/i386/ieee1275/startup.S ./kern/i386/ieee1275/startup.S > --- ../grub2/kern/i386/ieee1275/startup.S 2008-01-23 10:57:26.000000000 > +0100 > +++ ./kern/i386/ieee1275/startup.S 2008-04-18 13:29:57.000000000 +0200 > @@ -39,7 +39,7 @@ > start: > _start: > movl %eax, EXT_C(grub_ieee1275_entry_fn) > - jmp EXT_C(cmain) > + jmp EXT_C(grub_main) > > /* > * This call is special... it never returns... in fact it should simply > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp > ../grub2/kern/ieee1275/cmain.c ./kern/ieee1275/cmain.c > --- ../grub2/kern/ieee1275/cmain.c 2008-04-12 23:09:35.000000000 +0200 > +++ ./kern/ieee1275/cmain.c 2008-04-18 13:30:43.000000000 +0200 > @@ -151,9 +151,8 @@ grub_ieee1275_find_options (void) > #undef SF > #undef OHW > > -void cmain (void); > void > -cmain (void) > +grub_ieee1275_init (void) > { > grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); > > @@ -162,9 +161,4 @@ cmain (void) > grub_ieee1275_mmu = 0; > > grub_ieee1275_find_options (); > - > - /* Now invoke the main function. */ > - grub_main (); > - > - /* Never reached. */ > } > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp > ../grub2/kern/ieee1275/init.c ./kern/ieee1275/init.c > --- ../grub2/kern/ieee1275/init.c 2008-04-12 23:09:36.000000000 +0200 > +++ ./kern/ieee1275/init.c 2008-04-18 13:31:51.000000000 +0200 > @@ -180,6 +180,8 @@ grub_machine_init (void) > char args[256]; > int actual; > > + grub_ieee1275_init (); > + > grub_console_init (); > #ifdef __i386__ > grub_keyboard_controller_init (); > diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp > ../grub2/kern/powerpc/ieee1275/crt0.S ./kern/powerpc/ieee1275/crt0.S > --- ../grub2/kern/powerpc/ieee1275/crt0.S 2008-01-19 12:41:00.000000000 > +0100 > +++ ./kern/powerpc/ieee1275/crt0.S 2008-04-18 13:30:12.000000000 +0200 > @@ -42,5 +42,5 @@ _start: > lis 9, [EMAIL PROTECTED] > stw 5, [EMAIL PROTECTED](9) > > - bl cmain > + bl grub_main > 1: b 1b > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- 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