[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/13] We can add piix3_dev now to PIIX3IrqState
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 10/13] We can add piix3_dev now to PIIX3IrqState |
Date: |
Fri, 28 Aug 2009 01:15:14 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/piix_pci.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 66aeb72..d77c6e6 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;
@@ -215,8 +216,6 @@ static void i440fx_initfn(PCIDevice *dev)
register_savevm("I440FX", 0, 2, i440fx_save, i440fx_load, d);
}
-static PIIX3State *piix3_dev;
-
PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq
*pic)
{
DeviceState *dev;
@@ -236,8 +235,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;
}
@@ -253,13 +253,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);
--
1.6.2.5
- [Qemu-devel] [PATCH 00/13] piix_pci cleanup, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 02/13] Split piix4 support from piix_pci.c, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 07/13] Create PIIX3State instead of using PCIDevice for PIIX3, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 03/13] low_set_irq is not used anywhere, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 04/13] Use PCII440FXState instead of generic PCIDevice, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 09/13] Fold piix3_init() intto i440fx_init, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 05/13] Move smm_enabled and isa_memory_mappings to PCII440FXState, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 08/13] Introduce PIIX3IrqState for piix3 irq's state, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 10/13] We can add piix3_dev now to PIIX3IrqState,
Juan Quintela <=
- [Qemu-devel] [PATCH 06/13] We want the argument pass to set_irq to be opaque, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 11/13] Save irq_state into PCII440FXState, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 13/13] Update SaveVM versions, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 12/13] pci_irq_levels[] belong to PIIX3State, Juan Quintela, 2009/08/27
- [Qemu-devel] [PATCH 01/13] piix4 don't use pci_irq_levels at all, Juan Quintela, 2009/08/27