From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Make gdb debugging a bit less painful
Date: Fri, 18 Apr 2008 13:32:59 +0200 [thread overview]
Message-ID: <20080418113259.GD26239@thorin> (raw)
In-Reply-To: <20080417222114.reel0vq6f40gsskc@webmail.spamcop.net>
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]
On Thu, Apr 17, 2008 at 10:21:14PM -0400, Pavel Roskin wrote:
> Quoting Robert Millan <rmh@aybabtu.com>:
>
> >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 /.)
[-- Attachment #2: cmain.diff --]
[-- Type: text/x-diff, Size: 2580 bytes --]
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
\f
+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, grub_ieee1275_entry_fn@ha
stw 5, grub_ieee1275_entry_fn@l(9)
- bl cmain
+ bl grub_main
1: b 1b
next prev parent reply other threads:[~2008-04-18 11:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-14 22:30 [PATCH] Make gdb debugging a bit less painful Lubomir Kundrak
2008-04-15 13:21 ` Robert Millan
2008-04-15 13:38 ` Robert Millan
2008-04-17 11:53 ` Lubomir Kundrak
2008-04-17 20:11 ` Robert Millan
2008-04-18 2:21 ` Pavel Roskin
2008-04-18 11:32 ` Robert Millan [this message]
2008-04-18 12:13 ` Robert Millan
2008-04-18 15:16 ` Pavel Roskin
2008-04-18 15:36 ` Robert Millan
2008-04-18 15:38 ` Bean
2008-04-18 15:45 ` Robert Millan
2008-04-18 13:58 ` Lubomir Kundrak
2008-04-18 15:54 ` Robert Millan
2008-04-15 19:01 ` Pavel Roskin
2008-04-17 11:54 ` Lubomir Kundrak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080418113259.GD26239@thorin \
--to=rmh@aybabtu.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.