[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 20/25] pci: factor out config update logic.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 20/25] pci: factor out config update logic. |
Date: |
Sat, 3 Oct 2009 05:16:12 +0900 |
Updating BAR in pci bar is specific to header type 00.
So split out the logic to common to header type 01 which
will be used later.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pci.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 2054902..ed9b785 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -659,16 +659,24 @@ uint32_t pci_default_read_config(PCIDevice *d,
return pcie_config_get(d, address, len);
}
-void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
+static void pci_default_write_config_common(PCIDevice *d,
+ uint32_t addr, uint32_t val, int l)
{
int i;
uint32_t config_size = pcie_config_size(d);
- uint8_t *orig = pci_write_config_init(d, addr, l);
+ assert(l == 1 || l == 2 || l == 4);
for(i = 0; i < l && addr < config_size; val >>= 8, ++i, ++addr) {
uint8_t wmask = d->wmask[addr];
d->config[addr] = (d->config[addr] & ~wmask) | (val & wmask);
}
+}
+
+void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
+{
+ uint8_t *orig = pci_write_config_init(d, addr, l);
+
+ pci_default_write_config_common(d, addr, val, l);
if (pci_config_changed(orig, d->config, addr, l,
PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_5 + 4) ||
--
1.6.0.2
- [Qemu-devel] [PATCH 08/25] pci: use helper functions to access pci config space., (continued)
- [Qemu-devel] [PATCH 08/25] pci: use helper functions to access pci config space., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 10/25] pci: introduce FMT_pcibus for printf format for pcibus_t., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 14/25] pci: factor out the logic to get pci device from address., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 25/25] pci/monitor: print out bridge's filtering values and so on., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 04/25] pci: use the symbolic constant, PCI_ROM_ADDRESS_ENABLE instead of 1., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 15/25] pci_host.h: split non-inline static function in pci_host.h into pci_host.c, Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 20/25] pci: factor out config update logic.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 18/25] pci: add helper functions for pci config write function., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 09/25] pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t, Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 11/25] pci: typedef pcibus_t as uint64_t instead of uint32_t., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 07/25] pci: helper functions to access PCIDevice::config, Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 23/25] pci: add helper function to initialize wmask., Isaku Yamahata, 2009/10/02
- [Qemu-devel] [PATCH 22/25] pci/brdige: qdevfy and initialize secondary bus and subordinate bus., Isaku Yamahata, 2009/10/02