qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] smc91x irq patch
Date: Wed, 19 Jul 2006 19:53:30 +0200	[thread overview]
Message-ID: <44BE719A.2000708@bellard.org> (raw)
In-Reply-To: <200607190429.22717.paul@codesourcery.com>

Paul Brook wrote:
> On Tuesday 18 July 2006 18:03, Thorsten Zitterell wrote:
> 
>>I am working on a Gumstix system [1] emulation for QEMU which is based
>>on a Intel XScale processor. The board has an expansion card for network
>>support which is a smc91x compatible NIC. However, the irq line is not
>>directly connected to the processor's interrupt controller but to an
>>GPIO which triggers an irq when a level edge is detected.
> 
> 
> As discussed on IRC this is the wrong way to do this. Instead use the 
> mechanisms in arm_pic.[ch] and make you GPIO emulation look like an interrupt 
> controller.
> 
> There's no point passing round both a pic callback and an object when we can 
> embed the callback in the object.

I don't think that adding a callback is bad. It can be useful to use the 
device with another CPU or IRQ controller for example.

In fact, I would like to go further by adding a type such as 
"QEMUSignal" which could be used for IRQs or any other I/Os. Then you 
can pass it to devices. You can used qemu_signal_set(QEMUSignal *signal, 
int level) to set the level and add listeners to get notified on the 
changes with something like: qemu_add_signal_cb(QEMUSignal *signal, void 
(*cb)(void *opaque), void *opaque).

Regards,

Fabrice.

  reply	other threads:[~2006-07-19 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18 12:54 [Qemu-devel] Small note about qemu/target-sh4/op.c Pablo Virolainen
2006-07-18 17:03 ` [Qemu-devel] smc91x irq patch Thorsten Zitterell
2006-07-19  3:29   ` Paul Brook
2006-07-19 17:53     ` Fabrice Bellard [this message]
2006-07-19 18:15       ` Paul Brook

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=44BE719A.2000708@bellard.org \
    --to=fabrice@bellard.org \
    --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).