[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/12] target-unicore32: Mark as unmigratable
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 01/12] target-unicore32: Mark as unmigratable |
Date: |
Fri, 1 Feb 2013 01:44:29 +0100 |
CPU_SAVE_VERSION 2 was bogus as both save and load would just throw a
hw_error(). Therefore we can without problems suppress registration of
"cpu_common" VMState by dropping CPU_SAVE_VERSION define and provide an
unmigratable "cpu" VMStateDescription for UniCore32CPU at device level
instead, where we can attach this the QOM way.
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
---
target-unicore32/Makefile.objs | 2 +-
target-unicore32/cpu.c | 8 ++++++++
target-unicore32/cpu.h | 2 --
target-unicore32/machine.c | 23 -----------------------
4 Dateien geändert, 9 Zeilen hinzugefügt(+), 26 Zeilen entfernt(-)
delete mode 100644 target-unicore32/machine.c
diff --git a/target-unicore32/Makefile.objs b/target-unicore32/Makefile.objs
index 8e143da..6b41b1e 100644
--- a/target-unicore32/Makefile.objs
+++ b/target-unicore32/Makefile.objs
@@ -1,4 +1,4 @@
obj-y += translate.o op_helper.o helper.o cpu.o
obj-y += ucf64_helper.o
-obj-$(CONFIG_SOFTMMU) += machine.o softmmu.o
+obj-$(CONFIG_SOFTMMU) += softmmu.o
diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
index c120440..18ef1c5 100644
--- a/target-unicore32/cpu.c
+++ b/target-unicore32/cpu.c
@@ -14,6 +14,7 @@
#include "cpu.h"
#include "qemu-common.h"
+#include "migration/vmstate.h"
static inline void set_feature(CPUUniCore32State *env, int feature)
{
@@ -96,11 +97,18 @@ static void uc32_cpu_initfn(Object *obj)
tlb_flush(env, 1);
}
+static const VMStateDescription vmstate_uc32_cpu = {
+ .name = "cpu",
+ .unmigratable = 1,
+};
+
static void uc32_cpu_class_init(ObjectClass *oc, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
cc->class_by_name = uc32_cpu_class_by_name;
+ dc->vmsd = &vmstate_uc32_cpu;
}
static void uc32_register_cpu_type(const UniCore32CPUInfo *info)
diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 509ce7c..ae9a9d6 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -133,8 +133,6 @@ int uc32_cpu_signal_handler(int host_signum, void *pinfo,
void *puc);
int uc32_cpu_handle_mmu_fault(CPUUniCore32State *env, target_ulong address,
int rw,
int mmu_idx);
-#define CPU_SAVE_VERSION 2
-
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _kernel
#define MMU_MODE1_SUFFIX _user
diff --git a/target-unicore32/machine.c b/target-unicore32/machine.c
deleted file mode 100644
index 60b2ec1..0000000
--- a/target-unicore32/machine.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Generic machine functions for UniCore32 ISA
- *
- * Copyright (C) 2010-2012 Guan Xuetao
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation, or any later version.
- * See the COPYING file in the top-level directory.
- */
-#include "hw/hw.h"
-
-void cpu_save(QEMUFile *f, void *opaque)
-{
- hw_error("%s not supported yet.\n", __func__);
-}
-
-int cpu_load(QEMUFile *f, void *opaque, int version_id)
-{
- hw_error("%s not supported yet.\n", __func__);
-
- return 0;
-}
--
1.7.10.4
- [Qemu-devel] [PULL 00/12] QOM CPUState patch queue 2013-02-01, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 02/12] target-microblaze: Mark as unmigratable, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 04/12] target-sh4: Mark as unmigratable, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 01/12] target-unicore32: Mark as unmigratable,
Andreas Färber <=
- [Qemu-devel] [PATCH 07/12] target-m68k: Rename CPU subtypes, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 06/12] target-m68k: Mark as unmigratable, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 05/12] target-s390x: Mark as unmigratable, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 11/12] target-i386: Pass X86CPU to cpu_x86_set_a20(), Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 08/12] target-openrisc: TYPE_OPENRISC_CPU should be abstract, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 10/12] target-unicore32: Rename CPU subtypes, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 03/12] target-xtensa: Mark as unmigratable, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 09/12] target-openrisc: Rename CPU subtypes, Andreas Färber, 2013/01/31
- [Qemu-devel] [PATCH 12/12] linux-user: bsd-user: Don't reset X86CPU twice, Andreas Färber, 2013/01/31