|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] [PATCH 2/3] Add PCI memory region registration |
Date: | Sun, 31 May 2009 14:50:10 +0300 |
User-agent: | Thunderbird 2.0.0.21 (X11/20090320) |
Christoph Hellwig wrote:
On Wed, May 27, 2009 at 05:33:37PM -0500, Anthony Liguori wrote:pci_register_io_region(&d->dev, 0, 0x100,PCI_ADDRESS_SPACE_IO, rtl8139_ioport_read, rtl8139_ioport_write, s);pci_register_io_region(&d->dev, 1, 0x100,PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_read, rtl8139_mmio_write, s);Moreover, you could probably drop the opaque parameter and and just use d->dev. I hope it's possible to get from one to the other.I also think this is a much more natural API, and would simplify drivers a lot. As for the naming the PCI spec uses the term bar for these PIO/MMIO regions, so maybe call it pci_register_bar or pci_setup_bar?
Note that this sets up an io region within a BAR, not a complete BAR. Currently PCI IO is a three stage setup process: - set up BAR - set up ram_addr - set up mapping between BAR and ram_addrWe'll need to keep this flexibility. I agree that helpers that collapse all three changes will help the majority of devices.
-- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |