qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] qdev-ify isa pic
Date: Wed, 10 Jun 2009 09:32:58 +0200	[thread overview]
Message-ID: <4A2F61AA.3020502@redhat.com> (raw)
In-Reply-To: <200906091658.15889.paul@codesourcery.com>

On 06/09/09 17:58, Paul Brook wrote:

>> Why doesn't sysbus_init_irq() call qdev_init_gpio_out()?
>
> Because some devices have both IRQs and GPIO outputs.

What is the point of this commit here ...

http://git.savannah.gnu.org/cgit/qemu.git/commit/?id=067a3ddc8876cee8451d6f690a051e413a593fdc

then?

In general I think we should handle as much as possible at DeviceState / 
DeviceInfo level.  Stuff which devices commonly have should live there: 
  IRQs, mmio, ioports, ... in DeviceState.  name, init and other generic 
callbacks, ... in DeviceInfo.

The bus structs should only hold stuff which is actually specific to 
that bus.  That is probably almost nothing for sysbus.  i2c has the xfer 
callbacks in I2CSlaveInfo.  Likewise pci can have the config space 
read/write callbacks in PCIDeviceInfo.

With more and more stuff coming to DeviceInfo it probably becomes more 
useful to have the device register functions just pass a DeviceInfo 
struct (or a bus-specific one like PCIDeviceInfo with DeviceInfo as 
element) to the register function, otherwise we'll end up with an 
ever-growing list of arguments ...

cheers,
   Gerd

  reply	other threads:[~2009-06-10  7:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 11:00 [Qemu-devel] [PATCH 1/3] qdev-ify isa pic Gerd Hoffmann
2009-06-09 11:01 ` [Qemu-devel] [PATCH 2/3] qdev: irq allocation in generic code Gerd Hoffmann
2009-06-09 11:01 ` [Qemu-devel] [PATCH 3/3] qdev: switch isa pic to generic irq allocation Gerd Hoffmann
2009-06-09 15:01 ` [Qemu-devel] [PATCH 1/3] qdev-ify isa pic Paul Brook
2009-06-09 15:24   ` Gerd Hoffmann
2009-06-09 15:32     ` Paul Brook
2009-06-09 15:51       ` Gerd Hoffmann
2009-06-09 15:58         ` Paul Brook
2009-06-10  7:32           ` Gerd Hoffmann [this message]
2009-06-10  9:43             ` Filip Navara
2009-06-10  9:50               ` Gerd Hoffmann
2009-06-10 14:29                 ` 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=4A2F61AA.3020502@redhat.com \
    --to=kraxel@redhat.com \
    --cc=paul@codesourcery.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).