All of lore.kernel.org
 help / color / mirror / Atom feed
* help with powerpc asm (moving grub_ieee1275_entry_fn initialization to crt0.S)
@ 2008-01-13 19:12 Robert Millan
  2008-01-15 20:08 ` Robert Millan
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Millan @ 2008-01-13 19:12 UTC (permalink / raw)
  To: grub-devel

[-- 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-01-19 11:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-13 19:12 help with powerpc asm (moving grub_ieee1275_entry_fn initialization to crt0.S) Robert Millan
2008-01-15 20:08 ` 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

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.