Commit 4143f3e09cf780fdd2f1461f19a4e63987a09660

Authored by malc
1 parent cc53d26d

Fix vm state save/load


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4742 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 13 additions and 0 deletions
hw/cs4231a.c
... ... @@ -601,17 +601,23 @@ static void cs_save(QEMUFile *f, void *opaque)
601 601 {
602 602 CSState *s = opaque;
603 603 unsigned int i;
  604 + uint32_t val;
604 605  
605 606 for (i = 0; i < CS_REGS; i++)
606 607 qemu_put_be32s(f, &s->regs[i]);
607 608  
608 609 qemu_put_buffer(f, s->dregs, CS_DREGS);
  610 + val = s->dma_running; qemu_put_be32s(f, &val);
  611 + val = s->audio_free; qemu_put_be32s(f, &val);
  612 + val = s->transferred; qemu_put_be32s(f, &val);
  613 + val = s->aci_counter; qemu_put_be32s(f, &val);
609 614 }
610 615  
611 616 static int cs_load(QEMUFile *f, void *opaque, int version_id)
612 617 {
613 618 CSState *s = opaque;
614 619 unsigned int i;
  620 + uint32_t val, dma_running;
615 621  
616 622 if (version_id > 1)
617 623 return -EINVAL;
... ... @@ -620,6 +626,13 @@ static int cs_load(QEMUFile *f, void *opaque, int version_id)
620 626 qemu_get_be32s(f, &s->regs[i]);
621 627  
622 628 qemu_get_buffer(f, s->dregs, CS_DREGS);
  629 +
  630 + qemu_get_be32s(f, &dma_running);
  631 + qemu_get_be32s(f, &val); s->audio_free = val;
  632 + qemu_get_be32s(f, &val); s->transferred = val;
  633 + qemu_get_be32s(f, &val); s->aci_counter = val;
  634 + if (dma_running && (s->dregs[Interface_Configuration] & PEN))
  635 + cs_reset_voices (s, s->dregs[FS_And_Playback_Data_Format]);
623 636 return 0;
624 637 }
625 638  
... ...