From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNYZZ-0004xZ-AV for qemu-devel@nongnu.org; Mon, 07 Nov 2011 18:25:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNYZY-0001ll-3A for qemu-devel@nongnu.org; Mon, 07 Nov 2011 18:25:49 -0500 Received: from caibbdcaaaaf.dreamhost.com ([208.113.200.5]:39838 helo=homiemail-a80.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNYZX-0001lZ-OG for qemu-devel@nongnu.org; Mon, 07 Nov 2011 18:25:47 -0500 Message-ID: <4EB868F9.6050609@eagerm.com> Date: Mon, 07 Nov 2011 15:25:45 -0800 From: Michael Eager MIME-Version: 1.0 References: <4EB85FD7.2050004@eagerm.com> <20111107230521.GC14307@zapo> In-Reply-To: <20111107230521.GC14307@zapo> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] clk_setup decl missing in virtex_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: qemu-devel , Fabien Chouteau Works for me. On 11/07/2011 03:05 PM, Edgar E. Iglesias wrote: > On Mon, Nov 07, 2011 at 02:46:47PM -0800, Michael Eager wrote: >> The declaration of clk_setup is missing in >> qemu/hw/virtex_ml507.c: >> >> static void virtex_init(ram_addr_t ram_size, >> const char *boot_device, >> const char *kernel_filename, >> const char *kernel_cmdline, >> const char *initrd_filename, const char *cpu_model) >> { >> ... >> >> ... >> memset(clk_setup, 0, sizeof(clk_setup)); >> >> This SEGVs because clk_setup is an inline function defined in ppc.h. >> (I presume that the linker generates an out-of-line copy.) >> >> It isn't clear what the declaration should be. In ppc405_uc.c, there >> is a decl: >> clk_setup_t clk_setup[PPC405EP_CLK_NB]; > > > Hi > > the following patch seems to work on my side. Fabien, could > you please see if this was your intention? It seems to be > commit ddd1055b07fdfe488a22c2275adaca75f4206d30 that > introduced the segfault. > > Cheers > > commit 8e95771e4afb6e91c30a53943118afef4631b919 > Author: Edgar E. Iglesias > Date: Tue Nov 8 00:00:55 2011 +0100 > > virtex: Remove memset of clk_setup > > clk_setup is now a function. > > Signed-off-by: Edgar E. Iglesias > > diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c > index d31a204..5ea0e60 100644 > --- a/hw/virtex_ml507.c > +++ b/hw/virtex_ml507.c > @@ -202,7 +202,6 @@ static void virtex_init(ram_addr_t ram_size, > cpu_model = "440-Xilinx"; > } > > - memset(clk_setup, 0, sizeof(clk_setup)); > env = ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000); > qemu_register_reset(main_cpu_reset, env); > > -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077