diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-21 17:14:50 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-21 17:14:50 +0000 |
commit | 279a65442eb53e74083b31fa629a10c0ed78e3f0 (patch) | |
tree | 5335a9ec6f19c4a8ccc8a0ba75b741cf1f47d6e7 /hw | |
parent | fd07bef4b49cc69ef1905b0713a6bf23026cc536 (diff) |
Add calls to pci_device_save/load
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4766 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ac97.c | 11 | ||||
-rw-r--r-- | hw/es1370.c | 10 |
2 files changed, 17 insertions, 4 deletions
@@ -1190,6 +1190,8 @@ static void ac97_save (QEMUFile *f, void *opaque) uint8_t active[LAST_INDEX]; AC97LinkState *s = opaque; + pci_device_save (s->pci_dev, f); + qemu_put_be32s (f, &s->glob_cnt); qemu_put_be32s (f, &s->glob_sta); qemu_put_be32s (f, &s->cas); @@ -1217,13 +1219,18 @@ static void ac97_save (QEMUFile *f, void *opaque) static int ac97_load (QEMUFile *f, void *opaque, int version_id) { + int ret; size_t i; uint8_t active[LAST_INDEX]; AC97LinkState *s = opaque; - if (version_id != 1) + if (version_id != 2) return -EINVAL; + ret = pci_device_load (s->pci_dev, f); + if (ret) + return ret; + qemu_get_be32s (f, &s->glob_cnt); qemu_get_be32s (f, &s->glob_sta); qemu_get_be32s (f, &s->cas); @@ -1370,7 +1377,7 @@ int ac97_init (PCIBus *bus, AudioState *audio) pci_register_io_region (&d->dev, 0, 256 * 4, PCI_ADDRESS_SPACE_IO, ac97_map); pci_register_io_region (&d->dev, 1, 64 * 4, PCI_ADDRESS_SPACE_IO, ac97_map); - register_savevm ("ac97", 0, 1, ac97_save, ac97_load, s); + register_savevm ("ac97", 0, 2, ac97_save, ac97_load, s); qemu_register_reset (ac97_on_reset, s); AUD_register_card (audio, "ac97", &s->card); ac97_on_reset (s); diff --git a/hw/es1370.c b/hw/es1370.c index 754f621a17..a2a017bd5f 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -936,6 +936,7 @@ static void es1370_save (QEMUFile *f, void *opaque) ES1370State *s = opaque; size_t i; + pci_device_save (s->pci_dev, f); for (i = 0; i < NB_CHANNELS; ++i) { struct chan *d = &s->chan[i]; qemu_put_be32s (f, &d->shift); @@ -953,13 +954,18 @@ static void es1370_save (QEMUFile *f, void *opaque) static int es1370_load (QEMUFile *f, void *opaque, int version_id) { + int ret; uint32_t ctl, sctl; ES1370State *s = opaque; size_t i; - if (version_id != 1) + if (version_id != 2) return -EINVAL; + ret = pci_device_load (s->pci_dev, f); + if (ret) + return ret; + for (i = 0; i < NB_CHANNELS; ++i) { struct chan *d = &s->chan[i]; qemu_get_be32s (f, &d->shift); @@ -1056,7 +1062,7 @@ int es1370_init (PCIBus *bus, AudioState *audio) s->pci_dev = &d->dev; pci_register_io_region (&d->dev, 0, 256, PCI_ADDRESS_SPACE_IO, es1370_map); - register_savevm ("es1370", 0, 1, es1370_save, es1370_load, s); + register_savevm ("es1370", 0, 2, es1370_save, es1370_load, s); qemu_register_reset (es1370_on_reset, s); AUD_register_card (audio, "es1370", &s->card); |