aboutsummaryrefslogtreecommitdiff
path: root/hw/piix_pci.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-28 15:28:21 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-04 09:37:24 -0500
commitfd83e9b9dc7adac8244c613e0a51baa4610bb46d (patch)
tree0615a107b2d7f21cac958897ad8dc08b15cdb0d2 /hw/piix_pci.c
parent85a750ca90ec78b4288b84b716dda2d90643ae7f (diff)
downloadqemu-fd83e9b9dc7adac8244c613e0a51baa4610bb46d.zip
qemu-fd83e9b9dc7adac8244c613e0a51baa4610bb46d.tar.gz
qemu-fd83e9b9dc7adac8244c613e0a51baa4610bb46d.tar.bz2
We can add piix3_dev now to PIIX3IrqState
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/piix_pci.c')
-rw-r--r--hw/piix_pci.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 86582fe..92884d9 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -38,6 +38,7 @@ typedef struct PIIX3State {
} PIIX3State;
typedef struct PIIX3IrqState {
+ PIIX3State *piix3;
qemu_irq *pic;
} PIIX3IrqState;
@@ -217,8 +218,6 @@ static int i440fx_initfn(PCIDevice *dev)
return 0;
}
-static PIIX3State *piix3_dev;
-
PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic)
{
DeviceState *dev;
@@ -238,8 +237,9 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *
d = pci_create_simple(b, 0, "i440FX");
*pi440fx_state = DO_UPCAST(PCII440FXState, dev, d);
- piix3_dev = DO_UPCAST(PIIX3State, dev, pci_create_simple(b, -1, "PIIX3"));
- *piix3_devfn = piix3_dev->dev.devfn;
+ irq_state->piix3 = DO_UPCAST(PIIX3State, dev,
+ pci_create_simple(b, -1, "PIIX3"));
+ *piix3_devfn = irq_state->piix3->dev.devfn;
return b;
}
@@ -255,13 +255,13 @@ static void piix3_set_irq(void *opaque, int irq_num, int level)
/* now we change the pic irq level according to the piix irq mappings */
/* XXX: optimize */
- pic_irq = piix3_dev->dev.config[0x60 + irq_num];
+ pic_irq = irq_state->piix3->dev.config[0x60 + irq_num];
if (pic_irq < 16) {
/* The pic level is the logical OR of all the PCI irqs mapped
to it */
pic_level = 0;
for (i = 0; i < 4; i++) {
- if (pic_irq == piix3_dev->dev.config[0x60 + i])
+ if (pic_irq == irq_state->piix3->dev.config[0x60 + i])
pic_level |= pci_irq_levels[i];
}
qemu_set_irq(irq_state->pic[pic_irq], pic_level);