j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: 2009-01-04 20:25:41 +0100 (Sun, 04 Jan 2009) New Revision: 349
Modified: openbios-devel/arch/ppc/qemu/kernel.h openbios-devel/arch/ppc/qemu/main.c openbios-devel/arch/ppc/qemu/start.S Log: Pass initrd parameters to preloaded Linux kernel like Yaboot does
Modified: openbios-devel/arch/ppc/qemu/kernel.h =================================================================== --- openbios-devel/arch/ppc/qemu/kernel.h 2009-01-04 16:01:50 UTC (rev 348) +++ openbios-devel/arch/ppc/qemu/kernel.h 2009-01-04 19:25:41 UTC (rev 349) @@ -22,7 +22,7 @@ /* start.S */ extern void flush_icache_range( char *start, char *stop ); extern char of_rtas_start[], of_rtas_end[]; -extern void call_elf( ulong elf_entry ); +extern void call_elf( ulong arg1, ulong arg2, ulong elf_entry );
/* methods.c */ extern void node_methods_init( const char *cpuname );
Modified: openbios-devel/arch/ppc/qemu/main.c =================================================================== --- openbios-devel/arch/ppc/qemu/main.c 2009-01-04 16:01:50 UTC (rev 348) +++ openbios-devel/arch/ppc/qemu/main.c 2009-01-04 19:25:41 UTC (rev 349) @@ -41,7 +41,7 @@ transfer_control_to_elf( ulong elf_entry ) { ELF_DPRINTF("Starting ELF boot loader\n"); - call_elf( elf_entry ); + call_elf( 0, 0, elf_entry );
fatal_error("call_elf returned unexpectedly\n"); } @@ -302,9 +302,10 @@ cmdline = nvram_read_be32(0x40); initrd_image = nvram_read_be32(0x48); initrd_size = nvram_read_be32(0x4c); - printk("[ppc] Kernel already loaded (0x%8.8lx + 0x%8.8lx)\n", - kernel_image, kernel_size); - call_elf(kernel_image); + printk("[ppc] Kernel already loaded (0x%8.8lx + 0x%8.8lx) " + "(initrd 0x%8.8lx + 0x%8.8lx)\n", + kernel_image, kernel_size, initrd_image, initrd_size); + call_elf(initrd_image, initrd_size, kernel_image); } }
Modified: openbios-devel/arch/ppc/qemu/start.S =================================================================== --- openbios-devel/arch/ppc/qemu/start.S 2009-01-04 16:01:50 UTC (rev 348) +++ openbios-devel/arch/ppc/qemu/start.S 2009-01-04 19:25:41 UTC (rev 349) @@ -243,17 +243,19 @@ * r5 = clint interface handler * r6 = address of client program arguments (unused) * r7 = length of client program arguments (unsed) + * + * Yaboot and Linux use r3 and r4 for initrd address and size */ .data saved_stack: .long 0 .previous - /* void call_elf( entry ) */ + /* void call_elf( arg1, arg2, entry ) */ GLOBL(call_elf): mflr r0 stwu r1,-16(r1) stw r0,20(r1) - mtlr r3 + mtlr r5 lis r8,HA(saved_stack) addi r8,r8,LO(saved_stack) // save our stack pointer stw r1,0(r8)