qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] qdev-ify isa pic


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 1/3] qdev-ify isa pic
Date: Wed, 10 Jun 2009 09:32:58 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

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 via email to

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