From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Subject: help with powerpc asm (moving grub_ieee1275_entry_fn initialization to crt0.S)
Date: Sun, 13 Jan 2008 20:12:51 +0100 [thread overview]
Message-ID: <20080113191251.GA9050@thorin> (raw)
[-- Attachment #1: Type: text/plain, Size: 706 bytes --]
Hi,
For the i386-ieee1275 port, I'd need to move grub_ieee1275_entry_fn
initialization in powerpc from cmain.c to crt0.S, so that code in cmain.c
can be shared with i386.
The problem is I have no clue about powerpc assembler. On i386, this is
just done with a "movl %eax, EXT_C(grub_ieee1275_entry_fn)" but I don't know
the equivalent. Furthermore, the code in crt0.S seems to be pushing arguments
(up to 3 according to cmain.c) in a loop, which got me really confused.
Anyone who is familiar with powerpc assembler could have a look? See attached
patch.
--
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: grub_ieee1275_entry_fn.diff --]
[-- Type: text/x-diff, Size: 977 bytes --]
diff -ur grub2/kern/powerpc/ieee1275/cmain.c grub2.powerpc/kern/powerpc/ieee1275/cmain.c
--- grub2/kern/powerpc/ieee1275/cmain.c 2007-12-30 09:52:05.000000000 +0100
+++ grub2.powerpc/kern/powerpc/ieee1275/cmain.c 2008-01-13 20:01:48.000000000 +0100
@@ -102,12 +102,9 @@
}
}
-void cmain (uint32_t r3, uint32_t r4, uint32_t r5);
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 grub2.powerpc/kern/powerpc/ieee1275/crt0.S
--- grub2/kern/powerpc/ieee1275/crt0.S 2007-07-22 01:32:27.000000000 +0200
+++ grub2.powerpc/kern/powerpc/ieee1275/crt0.S 2008-01-13 20:01:34.000000000 +0100
@@ -38,5 +38,7 @@
2: stwu 2, 4(6) /* We know r2 is already 0 from above. */
bdnz 2b
+ /* initialize EXT_C(grub_ieee1275_entry_fn) */
+
bl cmain
1: b 1b
next reply other threads:[~2008-01-13 19:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-13 19:12 Robert Millan [this message]
2008-01-15 20:08 ` help with powerpc asm (moving grub_ieee1275_entry_fn initialization to crt0.S) Robert Millan
2008-01-17 7:54 ` Pavel Roskin
2008-01-17 12:17 ` Robert Millan
2008-01-17 17:30 ` Pavel Roskin
2008-01-17 19:11 ` Robert Millan
2008-01-17 20:08 ` Pavel Roskin
2008-01-19 11:40 ` Robert Millan
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=20080113191251.GA9050@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.