]> Git Repo - qemu.git/commitdiff
openpic: fix up loadvm under -M mac99
authorMark Cave-Ayland <[email protected]>
Mon, 9 Feb 2015 22:40:50 +0000 (22:40 +0000)
committerAlexander Graf <[email protected]>
Mon, 9 Mar 2015 14:00:06 +0000 (15:00 +0100)
Issuing loadvm under -M mac99 would fail for two reasons: firstly an incorrect
version number for openpic would cause openpic_load() to abort, and secondly
a cut/paste error when restoring the IVPR and IDR registers caused subsequent
vmstate sections to become misaligned and abort early.

Signed-off-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
hw/intc/openpic.c

index e76d7d1db7cfdcc2a7c8f00644372b83022c503d..9d3beb1817400c705a7b56578b9ea6e05f392175 100644 (file)
@@ -1366,7 +1366,7 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id)
     OpenPICState *opp = (OpenPICState *)opaque;
     unsigned int i, nb_cpus;
 
-    if (version_id != 1) {
+    if (version_id != 2) {
         return -EINVAL;
     }
 
@@ -1398,13 +1398,11 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id)
     for (i = 0; i < opp->max_irq; i++) {
         uint32_t val;
 
-        val = qemu_get_be32(f);
-        write_IRQreg_idr(opp, i, val);
         val = qemu_get_be32(f);
         write_IRQreg_ivpr(opp, i, val);
+        val = qemu_get_be32(f);
+        write_IRQreg_idr(opp, i, val);
 
-        qemu_get_be32s(f, &opp->src[i].ivpr);
-        qemu_get_be32s(f, &opp->src[i].idr);
         qemu_get_be32s(f, &opp->src[i].destmask);
         qemu_get_sbe32s(f, &opp->src[i].last_cpu);
         qemu_get_sbe32s(f, &opp->src[i].pending);
This page took 0.029719 seconds and 4 git commands to generate.