[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/13] pci_irq_levels[] belong to PIIX3State
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 12/13] pci_irq_levels[] belong to PIIX3State |
Date: |
Fri, 28 Aug 2009 01:15:16 +0200 |
With previous cleanups, now it is possible to put it where it belongs
Signed-off-by: Juan Quintela <address@hidden>
---
hw/piix_pci.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 8e01a52..580c987 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -35,6 +35,7 @@ typedef PCIHostState I440FXState;
typedef struct PIIX3State {
PCIDevice dev;
+ int pci_irq_levels[4];
} PIIX3State;
typedef struct PIIX3IrqState {
@@ -73,8 +74,6 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
return (irq_num + slot_addend) & 3;
}
-static int pci_irq_levels[4];
-
static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r)
{
uint32_t addr;
@@ -164,7 +163,7 @@ static void i440fx_save(QEMUFile* f, void *opaque)
qemu_put_8s(f, &d->smm_enabled);
for (i = 0; i < 4; i++)
- qemu_put_be32(f, pci_irq_levels[i]);
+ qemu_put_be32(f, d->irq_state->piix3->pci_irq_levels[i]);
}
static int i440fx_load(QEMUFile* f, void *opaque, int version_id)
@@ -182,7 +181,7 @@ static int i440fx_load(QEMUFile* f, void *opaque, int
version_id)
if (version_id >= 2)
for (i = 0; i < 4; i++)
- pci_irq_levels[i] = qemu_get_be32(f);
+ d->irq_state->piix3->pci_irq_levels[i] = qemu_get_be32(f);
return 0;
}
@@ -251,7 +250,7 @@ static void piix3_set_irq(void *opaque, int irq_num, int
level)
int i, pic_irq, pic_level;
PIIX3IrqState *irq_state = opaque;
- pci_irq_levels[irq_num] = level;
+ irq_state->piix3->pci_irq_levels[irq_num] = level;
/* now we change the pic irq level according to the piix irq mappings */
/* XXX: optimize */
@@ -262,7 +261,7 @@ static void piix3_set_irq(void *opaque, int irq_num, int
level)
pic_level = 0;
for (i = 0; i < 4; i++) {
if (pic_irq == irq_state->piix3->dev.config[0x60 + i])
- pic_level |= pci_irq_levels[i];
+ pic_level |= irq_state->piix3->pci_irq_levels[i];
}
qemu_set_irq(irq_state->pic[pic_irq], pic_level);
}
@@ -305,7 +304,7 @@ static void piix3_reset(void *opaque)
pci_conf[0xac] = 0x00;
pci_conf[0xae] = 0x00;
- memset(pci_irq_levels, 0, sizeof(pci_irq_levels));
+ memset(d->pci_irq_levels, 0, sizeof(d->pci_irq_levels));
}
static void piix_save(QEMUFile* f, void *opaque)
--
1.6.2.5
- [Qemu-devel] [PATCH 07/13] Create PIIX3State instead of using PCIDevice for PIIX3, (continued)
- [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, 2009/08/27
- [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 <=
- [Qemu-devel] [PATCH 01/13] piix4 don't use pci_irq_levels at all, Juan Quintela, 2009/08/27