Commit 5425a2164c99de50ac79e29cdd2cafbc3aafd2f4

Authored by blueswir1
1 parent 3299908c

Fix Sparc32 device save methods


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2657 c046a42c-6fe2-441c-8c8c-71466251a162
hw/esp.c
@@ -507,15 +507,21 @@ static void esp_save(QEMUFile *f, void *opaque) @@ -507,15 +507,21 @@ static void esp_save(QEMUFile *f, void *opaque)
507 qemu_put_be32s(f, &s->ti_rptr); 507 qemu_put_be32s(f, &s->ti_rptr);
508 qemu_put_be32s(f, &s->ti_wptr); 508 qemu_put_be32s(f, &s->ti_wptr);
509 qemu_put_buffer(f, s->ti_buf, TI_BUFSZ); 509 qemu_put_buffer(f, s->ti_buf, TI_BUFSZ);
  510 + qemu_put_be32s(f, &s->sense);
510 qemu_put_be32s(f, &s->dma); 511 qemu_put_be32s(f, &s->dma);
  512 + qemu_put_buffer(f, s->cmdbuf, TI_BUFSZ);
  513 + qemu_put_be32s(f, &s->cmdlen);
  514 + qemu_put_be32s(f, &s->do_cmd);
  515 + qemu_put_be32s(f, &s->dma_left);
  516 + // There should be no transfers in progress, so dma_counter is not saved
511 } 517 }
512 518
513 static int esp_load(QEMUFile *f, void *opaque, int version_id) 519 static int esp_load(QEMUFile *f, void *opaque, int version_id)
514 { 520 {
515 ESPState *s = opaque; 521 ESPState *s = opaque;
516 522
517 - if (version_id != 2)  
518 - return -EINVAL; // Cannot emulate 1 523 + if (version_id != 3)
  524 + return -EINVAL; // Cannot emulate 2
519 525
520 qemu_get_buffer(f, s->rregs, ESP_MAXREG); 526 qemu_get_buffer(f, s->rregs, ESP_MAXREG);
521 qemu_get_buffer(f, s->wregs, ESP_MAXREG); 527 qemu_get_buffer(f, s->wregs, ESP_MAXREG);
@@ -523,7 +529,12 @@ static int esp_load(QEMUFile *f, void *opaque, int version_id) @@ -523,7 +529,12 @@ static int esp_load(QEMUFile *f, void *opaque, int version_id)
523 qemu_get_be32s(f, &s->ti_rptr); 529 qemu_get_be32s(f, &s->ti_rptr);
524 qemu_get_be32s(f, &s->ti_wptr); 530 qemu_get_be32s(f, &s->ti_wptr);
525 qemu_get_buffer(f, s->ti_buf, TI_BUFSZ); 531 qemu_get_buffer(f, s->ti_buf, TI_BUFSZ);
  532 + qemu_get_be32s(f, &s->sense);
526 qemu_get_be32s(f, &s->dma); 533 qemu_get_be32s(f, &s->dma);
  534 + qemu_get_buffer(f, s->cmdbuf, TI_BUFSZ);
  535 + qemu_get_be32s(f, &s->cmdlen);
  536 + qemu_get_be32s(f, &s->do_cmd);
  537 + qemu_get_be32s(f, &s->dma_left);
527 538
528 return 0; 539 return 0;
529 } 540 }
@@ -568,7 +579,7 @@ void *esp_init(BlockDriverState **bd, uint32_t espaddr, void *dma_opaque) @@ -568,7 +579,7 @@ void *esp_init(BlockDriverState **bd, uint32_t espaddr, void *dma_opaque)
568 579
569 esp_reset(s); 580 esp_reset(s);
570 581
571 - register_savevm("esp", espaddr, 2, esp_save, esp_load, s); 582 + register_savevm("esp", espaddr, 3, esp_save, esp_load, s);
572 qemu_register_reset(esp_reset, s); 583 qemu_register_reset(esp_reset, s);
573 584
574 return s; 585 return s;
hw/slavio_serial.c
@@ -688,6 +688,7 @@ void slavio_serial_ms_kbd_init(int base, qemu_irq irq) @@ -688,6 +688,7 @@ void slavio_serial_ms_kbd_init(int base, qemu_irq irq)
688 688
689 qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0, "QEMU Sun Mouse"); 689 qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0, "QEMU Sun Mouse");
690 qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]); 690 qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]);
  691 + register_savevm("slavio_serial_mouse", base, 2, slavio_serial_save, slavio_serial_load, s);
691 qemu_register_reset(slavio_serial_reset, s); 692 qemu_register_reset(slavio_serial_reset, s);
692 slavio_serial_reset(s); 693 slavio_serial_reset(s);
693 } 694 }
hw/tcx.c
@@ -243,6 +243,8 @@ static int tcx_load(QEMUFile *f, void *opaque, int version_id) @@ -243,6 +243,8 @@ static int tcx_load(QEMUFile *f, void *opaque, int version_id)
243 qemu_get_8s(f, &s->dac_index); 243 qemu_get_8s(f, &s->dac_index);
244 qemu_get_8s(f, &s->dac_state); 244 qemu_get_8s(f, &s->dac_state);
245 update_palette_entries(s, 0, 256); 245 update_palette_entries(s, 0, 256);
  246 + tcx_invalidate_display(s);
  247 +
246 return 0; 248 return 0;
247 } 249 }
248 250