mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
libqos: Implement mmio accessors in terms of mem{read,write}
In the libqos PCI code we now have accessors both for registers (byte significance preserving) and for streaming data (byte address order preserving). These exist in both the interface for qtest drivers and in the machine specific backends. However, the register-style accessors aren't actually necessary in the backend. They can be implemented in terms of the byte address order preserving accessors by the libqos wrappers. This works because PCI is always little endian. This does assume that the back end byte address order preserving accessors will perform the equivalent of a single bus transaction for short lengths. This is the case, and in fact they currently end up using the same cpu_physical_memory_rw() implementation within the qtest accelerator. 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
9a84f88947
commit
352d664cce
4 changed files with 14 additions and 96 deletions
|
@ -27,18 +27,10 @@ struct QPCIBus {
|
|||
uint16_t (*pio_readw)(QPCIBus *bus, uint32_t addr);
|
||||
uint32_t (*pio_readl)(QPCIBus *bus, uint32_t addr);
|
||||
|
||||
uint8_t (*mmio_readb)(QPCIBus *bus, uint32_t addr);
|
||||
uint16_t (*mmio_readw)(QPCIBus *bus, uint32_t addr);
|
||||
uint32_t (*mmio_readl)(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 (*mmio_writeb)(QPCIBus *bus, uint32_t addr, uint8_t value);
|
||||
void (*mmio_writew)(QPCIBus *bus, uint32_t addr, uint16_t value);
|
||||
void (*mmio_writel)(QPCIBus *bus, uint32_t addr, uint32_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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue