Commit 279a65442eb53e74083b31fa629a10c0ed78e3f0

Authored by malc
1 parent fd07bef4

Add calls to pci_device_save/load

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4766 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 17 additions and 4 deletions
hw/ac97.c
... ... @@ -1190,6 +1190,8 @@ static void ac97_save (QEMUFile *f, void *opaque)
1190 1190 uint8_t active[LAST_INDEX];
1191 1191 AC97LinkState *s = opaque;
1192 1192  
  1193 + pci_device_save (s->pci_dev, f);
  1194 +
1193 1195 qemu_put_be32s (f, &s->glob_cnt);
1194 1196 qemu_put_be32s (f, &s->glob_sta);
1195 1197 qemu_put_be32s (f, &s->cas);
... ... @@ -1217,13 +1219,18 @@ static void ac97_save (QEMUFile *f, void *opaque)
1217 1219  
1218 1220 static int ac97_load (QEMUFile *f, void *opaque, int version_id)
1219 1221 {
  1222 + int ret;
1220 1223 size_t i;
1221 1224 uint8_t active[LAST_INDEX];
1222 1225 AC97LinkState *s = opaque;
1223 1226  
1224   - if (version_id != 1)
  1227 + if (version_id != 2)
1225 1228 return -EINVAL;
1226 1229  
  1230 + ret = pci_device_load (s->pci_dev, f);
  1231 + if (ret)
  1232 + return ret;
  1233 +
1227 1234 qemu_get_be32s (f, &s->glob_cnt);
1228 1235 qemu_get_be32s (f, &s->glob_sta);
1229 1236 qemu_get_be32s (f, &s->cas);
... ... @@ -1370,7 +1377,7 @@ int ac97_init (PCIBus *bus, AudioState *audio)
1370 1377  
1371 1378 pci_register_io_region (&d->dev, 0, 256 * 4, PCI_ADDRESS_SPACE_IO, ac97_map);
1372 1379 pci_register_io_region (&d->dev, 1, 64 * 4, PCI_ADDRESS_SPACE_IO, ac97_map);
1373   - register_savevm ("ac97", 0, 1, ac97_save, ac97_load, s);
  1380 + register_savevm ("ac97", 0, 2, ac97_save, ac97_load, s);
1374 1381 qemu_register_reset (ac97_on_reset, s);
1375 1382 AUD_register_card (audio, "ac97", &s->card);
1376 1383 ac97_on_reset (s);
... ...
hw/es1370.c
... ... @@ -936,6 +936,7 @@ static void es1370_save (QEMUFile *f, void *opaque)
936 936 ES1370State *s = opaque;
937 937 size_t i;
938 938  
  939 + pci_device_save (s->pci_dev, f);
939 940 for (i = 0; i < NB_CHANNELS; ++i) {
940 941 struct chan *d = &s->chan[i];
941 942 qemu_put_be32s (f, &d->shift);
... ... @@ -953,13 +954,18 @@ static void es1370_save (QEMUFile *f, void *opaque)
953 954  
954 955 static int es1370_load (QEMUFile *f, void *opaque, int version_id)
955 956 {
  957 + int ret;
956 958 uint32_t ctl, sctl;
957 959 ES1370State *s = opaque;
958 960 size_t i;
959 961  
960   - if (version_id != 1)
  962 + if (version_id != 2)
961 963 return -EINVAL;
962 964  
  965 + ret = pci_device_load (s->pci_dev, f);
  966 + if (ret)
  967 + return ret;
  968 +
963 969 for (i = 0; i < NB_CHANNELS; ++i) {
964 970 struct chan *d = &s->chan[i];
965 971 qemu_get_be32s (f, &d->shift);
... ... @@ -1056,7 +1062,7 @@ int es1370_init (PCIBus *bus, AudioState *audio)
1056 1062 s->pci_dev = &d->dev;
1057 1063  
1058 1064 pci_register_io_region (&d->dev, 0, 256, PCI_ADDRESS_SPACE_IO, es1370_map);
1059   - register_savevm ("es1370", 0, 1, es1370_save, es1370_load, s);
  1065 + register_savevm ("es1370", 0, 2, es1370_save, es1370_load, s);
1060 1066 qemu_register_reset (es1370_on_reset, s);
1061 1067  
1062 1068 AUD_register_card (audio, "es1370", &s->card);
... ...