On 05/18/2011 11:13 PM, Richard Henderson wrote:
On 05/18/2011 09:47 AM, Avi Kivity wrote:
> Yes. We'd change pci_register_bar() to accept a MemoryRegion.
Surely this detail would be hidden on the pci_dev->bus?
Not sure what you mean.
The reason I want pci_register_bar() to accept a memory region is that
some BARs are composed of multiple subregions, for example cirrus has a
RAM framebuffer an an mmio region in one BAR. So the device describes
the region relative to its start point and hands it off to the pci
subsystem, which can then enable or disable the region, and place it
anywhere in the bus address space it likes.
>> However, we are yet in troubles if we want to change that because
>> devices can only be on one bus - at least so far.
>
> Nothing prohibits a device from calling pci_register_bar() for one region
and some other API for another.
Sure, but the majority of PCI devices are plain pci, and
that sort of complexity should be hidden by default.
There is pci_register_bar_simple().
--
error compiling committee.c: too many arguments to function