[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 52/61] pci: add a hook to replace default pci bus in
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 52/61] pci: add a hook to replace default pci bus instead of 0 bus. |
Date: |
Wed, 30 Sep 2009 19:18:28 +0900 |
add a register function to replace default pci bus of 0.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pci.c | 10 ++++++++++
hw/pci.h | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 7aed737..05cd2cb 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -343,6 +343,14 @@ int pci_read_devaddr(Monitor *mon, const char *addr, int
*domp, int *busp,
return 0;
}
+static PCIBus *pci_default_bus;
+
+void pci_set_default_bus(PCIBus *bus)
+{
+ assert(pci_default_bus == NULL);
+ pci_default_bus = bus;
+}
+
static PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
{
int dom, bus;
@@ -350,6 +358,8 @@ static PCIBus *pci_get_bus_devfn(int *devfnp, const char
*devaddr)
if (!devaddr) {
*devfnp = -1;
+ if (pci_default_bus)
+ return pci_default_bus;
return pci_find_bus(0);
}
diff --git a/hw/pci.h b/hw/pci.h
index aed4a44..27a5d33 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -352,6 +352,7 @@ void pci_default_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len);
void pci_device_save(PCIDevice *s, QEMUFile *f);
int pci_device_load(PCIDevice *s, QEMUFile *f);
+void pci_set_default_bus(PCIBus *bus);
typedef void (*pci_set_irq_fn)(void *opaque, int irq_num, int level);
typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num);
--
1.6.0.2
- [Qemu-devel] [PATCH 18/61] pc: split out piix specific part from pc.c into pc_piix.c, (continued)
- [Qemu-devel] [PATCH 18/61] pc: split out piix specific part from pc.c into pc_piix.c, Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 42/61] pci/brdige: qdevfy and initialize secondary bus and subordinate bus., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 35/61] piix_pci: use pci_swizzle_map_irq_fn()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 34/61] pci: introduce pci_swizzle_map_irq_fn() for interrupt pin swizzle., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 60/61] pci: add opaque arg to pci_map_irq_fn., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 46/61] pci/bridge: implement intel 82801ba bridge., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 40/61] pci: use qdev to get parent bus with PCIBus., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 45/61] pci/monitor: print out bridge's filtering values and so on., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 29/61] pci: factor out the logic to get pci device from address., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 08/61] pc: make an unnecessary global variable, pit, local., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 52/61] pci: add a hook to replace default pci bus instead of 0 bus.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 33/61] pci: use the symbolic constant, PCI_ROM_ADDRESS_ENABLE instead of 1., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 48/61] pci id: add subclass codes for serial device., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 13/61] pc: split out cpu initialization from pc_init1() into pc_cpus_init()., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 10/61] pc: remove a global variable, RTCState *rtc_state., Isaku Yamahata, 2009/09/30
- [Qemu-devel] [PATCH 25/61] pci: use uint64_t for bar addr and size instead of uint32_t., Isaku Yamahata, 2009/09/30
- [Qemu-devel] Re: [PATCH 00/61] Q35 chip set and stuff., Michael S. Tsirkin, 2009/09/30
- Re: [Qemu-devel] [PATCH 00/61] Q35 chip set and stuff., Aurelien Jarno, 2009/09/30
- Re: [Qemu-devel] [PATCH 00/61] Q35 chip set and stuff., Blue Swirl, 2009/09/30
- [Qemu-devel] Re: [PATCH 00/61] Q35 chip set and stuff., Anthony Liguori, 2009/09/30