qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] Add PCI memory region registration


From: Christoph Hellwig
Subject: Re: [Qemu-devel] [PATCH 2/3] Add PCI memory region registration
Date: Sun, 31 May 2009 13:02:53 +0200
User-agent: Mutt/1.3.28i

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?

> I think it's worth looking at changing the signatures of the mem 
> read/write functions.  Introducing a size parameter would greatly 
> simplify adding 64-bit IO support, for instance.

Yeah.





reply via email to

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