diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2009-06-09 17:11:48 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-06-09 17:11:48 +0000 |
commit | 3dcd219f09d6c1817bf9a132899e6b925f7a0914 (patch) | |
tree | 1fb465ed328124ce9e65db0654a09f9ef3e34c4f | |
parent | 32c86e95b258515099d04f9eff48efc57a469bf7 (diff) |
Update irqs on reset and device load
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r-- | hw/e1000.c | 10 | ||||
-rw-r--r-- | hw/rtl8139.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/hw/e1000.c b/hw/e1000.c index a04d7b1fe4..03fad4cc94 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -150,12 +150,18 @@ ioport_map(PCIDevice *pci_dev, int region_num, uint32_t addr, } static void +update_irqs(E1000State *s) +{ + qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0); +} + +static void set_interrupt_cause(E1000State *s, int index, uint32_t val) { if (val) val |= E1000_ICR_INT_ASSERTED; s->mac_reg[ICR] = val; - qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0); + update_irqs(s); } static void @@ -970,6 +976,7 @@ nic_load(QEMUFile *f, void *opaque, int version_id) for (j = 0; j < mac_regarraystosave[i].size; j++) qemu_get_be32s(f, s->mac_reg + mac_regarraystosave[i].array0 + j); + update_irqs(s); return 0; } @@ -1068,6 +1075,7 @@ static void e1000_reset(void *opaque) memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init); d->rxbuf_min_shift = 1; memset(&d->tx, 0, sizeof d->tx); + update_irqs(d); } static void pci_e1000_init(PCIDevice *pci_dev) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index ea2ca25182..ea27dcfea0 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -3314,6 +3314,8 @@ static int rtl8139_load(QEMUFile* f,void* opaque,int version_id) s->cplus_enabled = s->CpCmd != 0; } + rtl8139_update_irq(s); + return 0; } |