mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
libqos: Add 64-bit PCI IO accessors
Currently the libqos PCI layer includes accessor helpers for 8, 16 and 32 bit reads and writes. It's likely that we'll want 64-bit accesses in the future (plenty of modern peripherals will have 64-bit reigsters). This adds them. For PIO (not MMIO) accesses on the PC backend, this is implemented as two 32-bit ins or outs. That's not ideal but AFAICT x86 doesn't have 64-bit versions of in and out. This patch also converts the single current user of 64-bit accesses - virtio-pci.c to use the new mechanism, rather than a sequence of 8 byte reads. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
9c268f8ae8
commit
f775f45ab8
5 changed files with 60 additions and 12 deletions
|
@ -26,10 +26,12 @@ struct QPCIBus {
|
|||
uint8_t (*pio_readb)(QPCIBus *bus, uint32_t addr);
|
||||
uint16_t (*pio_readw)(QPCIBus *bus, uint32_t addr);
|
||||
uint32_t (*pio_readl)(QPCIBus *bus, uint32_t addr);
|
||||
uint64_t (*pio_readq)(QPCIBus *bus, uint32_t addr);
|
||||
|
||||
void (*pio_writeb)(QPCIBus *bus, uint32_t addr, uint8_t value);
|
||||
void (*pio_writew)(QPCIBus *bus, uint32_t addr, uint16_t value);
|
||||
void (*pio_writel)(QPCIBus *bus, uint32_t addr, uint32_t value);
|
||||
void (*pio_writeq)(QPCIBus *bus, uint32_t addr, uint64_t value);
|
||||
|
||||
void (*memread)(QPCIBus *bus, uint32_t addr, void *buf, size_t len);
|
||||
void (*memwrite)(QPCIBus *bus, uint32_t addr, const void *buf, size_t len);
|
||||
|
@ -82,10 +84,12 @@ void qpci_config_writel(QPCIDevice *dev, uint8_t offset, uint32_t value);
|
|||
uint8_t qpci_io_readb(QPCIDevice *dev, void *data);
|
||||
uint16_t qpci_io_readw(QPCIDevice *dev, void *data);
|
||||
uint32_t qpci_io_readl(QPCIDevice *dev, void *data);
|
||||
uint64_t qpci_io_readq(QPCIDevice *dev, void *data);
|
||||
|
||||
void qpci_io_writeb(QPCIDevice *dev, void *data, uint8_t value);
|
||||
void qpci_io_writew(QPCIDevice *dev, void *data, uint16_t value);
|
||||
void qpci_io_writel(QPCIDevice *dev, void *data, uint32_t value);
|
||||
void qpci_io_writeq(QPCIDevice *dev, void *data, uint64_t value);
|
||||
|
||||
void qpci_memread(QPCIDevice *bus, void *data, void *buf, size_t len);
|
||||
void qpci_memwrite(QPCIDevice *bus, void *data, const void *buf, size_t len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue