x86: send mce_banks as an array
authorJuan Quintela <quintela@redhat.com>
Tue, 29 Sep 2009 20:48:56 +0000 (22:48 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 5 Oct 2009 14:32:41 +0000 (09:32 -0500)
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
target-i386/machine.c

index 7dc8afc..27c4a40 100644 (file)
@@ -157,11 +157,8 @@ void cpu_save(QEMUFile *f, void *opaque)
     if (env->mcg_cap) {
         qemu_put_be64s(f, &env->mcg_status);
         qemu_put_be64s(f, &env->mcg_ctl);
-        for (i = 0; i < MCE_BANKS_DEF; i++) {
-            qemu_put_be64s(f, &env->mce_banks[4*i]);
-            qemu_put_be64s(f, &env->mce_banks[4*i + 1]);
-            qemu_put_be64s(f, &env->mce_banks[4*i + 2]);
-            qemu_put_be64s(f, &env->mce_banks[4*i + 3]);
+        for (i = 0; i < MCE_BANKS_DEF * 4; i++) {
+            qemu_put_be64s(f, &env->mce_banks[i]);
         }
     }
     qemu_put_be64s(f, &env->tsc_aux);
@@ -355,11 +352,8 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
         if (env->mcg_cap) {
             qemu_get_be64s(f, &env->mcg_status);
             qemu_get_be64s(f, &env->mcg_ctl);
-            for (i = 0; i < MCE_BANKS_DEF; i++) {
-                qemu_get_be64s(f, &env->mce_banks[4*i]);
-                qemu_get_be64s(f, &env->mce_banks[4*i + 1]);
-                qemu_get_be64s(f, &env->mce_banks[4*i + 2]);
-                qemu_get_be64s(f, &env->mce_banks[4*i + 3]);
+            for (i = 0; i < MCE_BANKS_DEF * 4; i++) {
+                qemu_get_be64s(f, &env->mce_banks[i]);
             }
         }
     }