qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: crwulff@gmail.com
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <50549987.1020001@suse.de> (raw)
In-Reply-To: <CAAu8pHsT5CEFa3s9Ma0n-M__kgpekuH=aYurE9BjFNZVQf5-Bw@mail.gmail.com>

Am 11.09.2012 21:53, schrieb Blue Swirl:
> On Mon, Sep 10, 2012 at 12:20 AM,  <crwulff@gmail.com> 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 <crwulff@gmail.com>
>> + *
>> + * 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	other threads:[~2012-09-15 15:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Nios2-Resend2>
2012-09-10  0:19 ` [Qemu-devel] [PATCH 0/9] Altera NiosII support crwulff
2012-09-10  0:19   ` [Qemu-devel] [PATCH 1/9] NiosII: Add support for the Altera NiosII soft-core CPU crwulff
2012-09-11 20:19     ` Blue Swirl
2012-09-14  3:30       ` Chris Wulff
2012-09-11 21:34     ` Aurelien Jarno
2012-09-11 22:30       ` Richard Henderson
2012-09-11 23:18       ` Richard Henderson
2012-09-14  3:42       ` Chris Wulff
2012-09-15 15:33       ` Chris Wulff
2012-09-15 14:55     ` Andreas Färber
2012-09-10  0:20   ` [Qemu-devel] [PATCH 2/9] NiosII: Disassembly of NiosII instructions ported from GDB crwulff
2012-09-11 19:58     ` Blue Swirl
2012-09-10  0:20   ` [Qemu-devel] [PATCH 3/9] Altera: Add support for Altera devices required to boot linux on NiosII crwulff
2012-09-11 19:53     ` Blue Swirl
2012-09-15 15:06       ` Andreas Färber [this message]
2012-09-10  0:20   ` [Qemu-devel] [PATCH 4/9] LabX: Support for some Lab X FPGA devices crwulff
2012-09-11 20:22     ` Blue Swirl
2012-09-10  0:20   ` [Qemu-devel] [PATCH 5/9] FDT: Add additional access methods for array types and walking children crwulff
2012-09-12  0:12     ` Peter Crosthwaite
2012-09-10  0:20   ` [Qemu-devel] [PATCH 6/9] NiosII: Build system and documentation integration crwulff
2012-09-10  0:20   ` [Qemu-devel] [PATCH 7/9] NiosII: Add a config that is dynamically set up by a device tree file crwulff
2012-09-11 19:40     ` Blue Swirl
2012-09-10  0:20   ` [Qemu-devel] [PATCH 8/9] MicroBlaze: " crwulff
2012-09-11 19:27     ` Blue Swirl
2012-09-12  0:17       ` Peter Crosthwaite
2012-09-14 19:13         ` Blue Swirl
2012-09-11 23:59     ` Peter Crosthwaite
2012-09-14  4:01       ` Chris Wulff
2012-09-10  0:20   ` [Qemu-devel] [PATCH 9/9] xilinx_timer: Fix a compile error if debug messages are enabled crwulff
2012-09-12  0:25     ` Peter Crosthwaite
2012-09-11 23:40   ` [Qemu-devel] [PATCH 0/9] Altera NiosII support Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50549987.1020001@suse.de \
    --to=afaerber@suse.de \
    --cc=blauwirbel@gmail.com \
    --cc=crwulff@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).