[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V6 02/32] pci: introduce constant PCI_NUM_PINS for t
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH V6 02/32] pci: introduce constant PCI_NUM_PINS for the number of interrupt pins, 4. |
Date: |
Fri, 30 Oct 2009 21:20:56 +0900 |
introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.
and use it.
Signed-off-by: Isaku Yamahata <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
---
hw/pci.c | 4 ++--
hw/pci.h | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 1c95f88..e21098b 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -229,7 +229,7 @@ const VMStateDescription vmstate_pci_device = {
VMSTATE_INT32_LE(version_id, PCIDevice),
VMSTATE_SINGLE(config, PCIDevice, 0, vmstate_info_pci_config,
typeof_field(PCIDevice,config)),
- VMSTATE_INT32_ARRAY_V(irq_state, PCIDevice, 4, 2),
+ VMSTATE_INT32_ARRAY_V(irq_state, PCIDevice, PCI_NUM_PINS, 2),
VMSTATE_END_OF_LIST()
}
};
@@ -389,7 +389,7 @@ static PCIDevice *do_pci_register_device(PCIDevice
*pci_dev, PCIBus *bus,
pci_dev->config_read = config_read;
pci_dev->config_write = config_write;
bus->devices[devfn] = pci_dev;
- pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, 4);
+ pci_dev->irq = qemu_allocate_irqs(pci_set_irq, pci_dev, PCI_NUM_PINS);
pci_dev->version_id = 2; /* Current pci device vmstate version */
return pci_dev;
}
diff --git a/hw/pci.h b/hw/pci.h
index 93f93fb..476ff59 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -158,6 +158,8 @@ typedef struct PCIIORegion {
/* Size of the standard PCI config space */
#define PCI_CONFIG_SPACE_SIZE 0x100
+#define PCI_NUM_PINS 4 /* A-D */
+
/* Bits in cap_present field. */
enum {
QEMU_PCI_CAP_MSIX = 0x1,
@@ -192,7 +194,7 @@ struct PCIDevice {
qemu_irq *irq;
/* Current IRQ levels. Used internally by the generic PCI code. */
- int irq_state[4];
+ int irq_state[PCI_NUM_PINS];
/* Capability bits */
uint32_t cap_present;
--
1.6.0.2
- [Qemu-devel] [PATCH V6 00/32] pci: various pci clean up and pci express support., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 10/32] pci: clean up of pci_default_read_config., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 06/32] pci: use helper functions to access pci config space., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 05/32] pci: helper functions to access PCIDevice::config, Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 11/32] pci: make pci_bar() aware of header type 1., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 17/32] pci: 64bit bar support., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 16/32] pci: typedef pcibus_t as uint64_t instead of uint32_t., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 02/32] pci: introduce constant PCI_NUM_PINS for the number of interrupt pins, 4.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH V6 14/32] pci: introduce pcibus_t to represent pci bus address/size instead of uint32_t, Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 15/32] pci: introduce FMT_PCIBUS for printf format for pcibus_t., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 01/32] pci: fix PCI_DPRINTF() wrt variadic macro., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 18/32] pci: remove bus_num member from struct PCIBus., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 21/32] pci: move pci host stuff from pci.c to pci_host.c, Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 27/32] pci: teach pci_default_config_write() ROM bar for normal/bridge device ., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 26/32] pci: use range helper functions., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 03/32] pci: use PCI_SLOT() and PCI_FUNC()., Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 09/32] pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.h, Isaku Yamahata, 2009/10/30
- [Qemu-devel] [PATCH V6 12/32] pci_host.h: move functions in pci_host.h into .c file., Isaku Yamahata, 2009/10/30