qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/9] Altera: Add support for Altera devices requ


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 3/9] Altera: Add support for Altera devices required to boot linux on NiosII.
Date: Sat, 15 Sep 2012 17:06:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0

Am 11.09.2012 21:53, schrieb Blue Swirl:
> On Mon, Sep 10, 2012 at 12:20 AM,  <address@hidden> 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 <address@hidden>
>> + *
>> + * 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
>> + * <http://www.gnu.org/licenses/lgpl-2.1.html>
>> + */
>> +
>> +#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 = (CPUNios2State *)opaque;
> 
> 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="scripts/get_maintainer.pl --nogit-fallback").

Regards,
Andreas

> 
>> +    int type = 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);
>> +}

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]