From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCtxO-00019l-3m for qemu-devel@nongnu.org; Sat, 15 Sep 2012 11:06:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCtxM-0004Jo-VM for qemu-devel@nongnu.org; Sat, 15 Sep 2012 11:06:54 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56820 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCtxM-0004Ij-LV for qemu-devel@nongnu.org; Sat, 15 Sep 2012 11:06:52 -0400 Message-ID: <50549987.1020001@suse.de> Date: Sat, 15 Sep 2012 17:06:47 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1347236407-10465-1-git-send-email-crwulff@gmail.com> <1347236407-10465-4-git-send-email-crwulff@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 3/9] Altera: Add support for Altera devices required to boot linux on NiosII. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: crwulff@gmail.com Cc: Blue Swirl , qemu-devel@nongnu.org Am 11.09.2012 21:53, schrieb Blue Swirl: > On Mon, Sep 10, 2012 at 12:20 AM, wrote: >> diff --git a/hw/nios2_pic_cpu.c b/hw/nios2_pic_cpu.c >> new file mode 100644 >> index 0000000..c89b4ae >> --- /dev/null >> +++ b/hw/nios2_pic_cpu.c >> @@ -0,0 +1,48 @@ >> +/* >> + * QEMU Altera Nios II CPU interrupt wrapper logic. >> + * >> + * Copyright (c) 2012 Chris Wulff >> + * >> + * This library is free software; you can redistribute it and/or >> + * modify it under the terms of the GNU Lesser General Public >> + * License as published by the Free Software Foundation; either >> + * version 2.1 of the License, or (at your option) any later version. >> + * >> + * This library is distributed in the hope that it will be useful, >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + * Lesser General Public License for more details. >> + * >> + * You should have received a copy of the GNU Lesser General Public >> + * License along with this library; if not, see >> + * >> + */ >> + >> +#include "hw.h" >> +#include "pc.h" Why? >> +#include "nios2.h" >> + >> +void pic_info(Monitor *mon) >> +{ >> +} >> + >> +void irq_info(Monitor *mon) >> +{ >> +} Thought these stubs were no longer necessary... >> + >> +static void nios2_pic_cpu_handler(void *opaque, int irq, int level) >> +{ >> + CPUNios2State *env =3D (CPUNios2State *)opaque; >=20 > Useless cast in C. Please use Nios2CPU so that we can more easily make cpu_interrupt() and cpu_reset_interrupt() take a CPUState argument in the future. Please also split this patch up per device and always cc the appropriate maintainers to facilitate review (e.g., --cc-cmd=3D"scripts/get_maintainer.pl --nogit-fallback"). Regards, Andreas >=20 >> + int type =3D irq ? CPU_INTERRUPT_NMI : CPU_INTERRUPT_HARD; >> + >> + if (level) { >> + cpu_interrupt(env, type); >> + } else { >> + cpu_reset_interrupt(env, type); >> + } >> +} >> + >> +qemu_irq *nios2_pic_init_cpu(CPUNios2State *env) >> +{ >> + return qemu_allocate_irqs(nios2_pic_cpu_handler, env, 2); >> +} --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg