Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeNzZ-0004CF-GE for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:20:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeNzZ-0004Bn-0M for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:20:37 -0500 Received: from [199.232.76.173] (port=37851 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeNzY-0004Bi-Kx for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:20:36 -0500 Received: from hall.aurel32.net ([88.191.82.174]:56449) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LeNzY-0005ug-7H for qemu-devel@nongnu.org; Tue, 03 Mar 2009 01:20:36 -0500 Date: Tue, 3 Mar 2009 07:20:29 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] sh4: r2d --append option support Message-ID: <20090303062029.GD5159@volta.aurel32.net> References: <200902111315.n1BDFqfq024928@smtp09.dti.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <200902111315.n1BDFqfq024928@smtp09.dti.ne.jp> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Takashi YOSHII Cc: qemu-devel@nongnu.org On Wed, Feb 11, 2009 at 10:15:52PM +0900, takasi-y@ops.dti.ne.jp wrote: > Add linux kernel command line ("--append" option) support. > Fix kernel loading address to appropriate position when --append used. > Using --kernel but --append case is left untouched for backward compatibility. > > Signed-off-by: Takashi YOSHII > --- > I found this has not been posted as a patch to apply. > I hope this be merged into the branch(if any:) for next stable release. > /yoshii > --- > hw/r2d.c | 13 +++++++++---- > 1 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/hw/r2d.c b/hw/r2d.c > index e6b2bf4..7dcb723 100644 > --- a/hw/r2d.c > +++ b/hw/r2d.c > @@ -233,20 +233,25 @@ static void r2d_init(ram_addr_t ram_size, int vga_ram_size, > pci_nic_init(pci, &nd_table[i], -1, "ne2k_pci"); > > /* Todo: register on board registers */ > - { > + if (kernel_filename) { > int kernel_size; > /* initialization which should be done by firmware */ > stl_phys(SH7750_BCR1, 1<<3); /* cs3 SDRAM */ > stw_phys(SH7750_BCR2, 3<<(3*2)); /* cs3 32bit */ > > - kernel_size = load_image(kernel_filename, phys_ram_base); > + if (kernel_cmdline) { > + kernel_size = load_image(kernel_filename, phys_ram_base + 0x80000); > + env->pc = (SDRAM_BASE + 0x80000) | 0xa0000000; > + pstrcpy(phys_ram_base + 0x10100, 256, kernel_cmdline); You should use pstrcpy_targphys() instead and remove phys_ram_base. Otherwise looks good. > + } else { > + kernel_size = load_image(kernel_filename, phys_ram_base); > + env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */ > + } > > if (kernel_size < 0) { > fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); > exit(1); > } > - > - env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */ > } > } > > -- > 1.5.6.3 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net