提交 032ab092 编写于 作者: M Mark Cave-Ayland 提交者: Alexander Graf

openpic: fix up loadvm under -M mac99

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: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 4efef986
...@@ -1366,7 +1366,7 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id) ...@@ -1366,7 +1366,7 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id)
OpenPICState *opp = (OpenPICState *)opaque; OpenPICState *opp = (OpenPICState *)opaque;
unsigned int i, nb_cpus; unsigned int i, nb_cpus;
if (version_id != 1) { if (version_id != 2) {
return -EINVAL; return -EINVAL;
} }
...@@ -1398,13 +1398,11 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id) ...@@ -1398,13 +1398,11 @@ static int openpic_load(QEMUFile* f, void *opaque, int version_id)
for (i = 0; i < opp->max_irq; i++) { for (i = 0; i < opp->max_irq; i++) {
uint32_t val; uint32_t val;
val = qemu_get_be32(f);
write_IRQreg_idr(opp, i, val);
val = qemu_get_be32(f); val = qemu_get_be32(f);
write_IRQreg_ivpr(opp, i, val); 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_be32s(f, &opp->src[i].destmask);
qemu_get_sbe32s(f, &opp->src[i].last_cpu); qemu_get_sbe32s(f, &opp->src[i].last_cpu);
qemu_get_sbe32s(f, &opp->src[i].pending); qemu_get_sbe32s(f, &opp->src[i].pending);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册