aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-01 20:01:19 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-01 20:01:19 +0000
commit9656f324d25895ec16ebc5eaf624e28a96c1f1be (patch)
tree493d25a4b894fea24ee91d07efea4309044ba54c /exec.c
parenta5cdf952204931960bbb269494469843be789b52 (diff)
downloadqemu-9656f324d25895ec16ebc5eaf624e28a96c1f1be.zip
qemu-9656f324d25895ec16ebc5eaf624e28a96c1f1be.tar.gz
qemu-9656f324d25895ec16ebc5eaf624e28a96c1f1be.tar.bz2
Move interrupt_request and user_mode_only to common cpu state.
Save and restore env->interrupt_request and env->halted. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4817 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 64c87b3..f02abe0 100644
--- a/exec.c
+++ b/exec.c
@@ -443,6 +443,33 @@ void cpu_exec_init_all(unsigned long tb_size)
#endif
}
+#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
+
+#define CPU_COMMON_SAVE_VERSION 1
+
+static void cpu_common_save(QEMUFile *f, void *opaque)
+{
+ CPUState *env = opaque;
+
+ qemu_put_be32s(f, &env->halted);
+ qemu_put_be32s(f, &env->interrupt_request);
+}
+
+static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)
+{
+ CPUState *env = opaque;
+
+ if (version_id != CPU_COMMON_SAVE_VERSION)
+ return -EINVAL;
+
+ qemu_get_be32s(f, &env->halted);
+ qemu_put_be32s(f, &env->interrupt_request);
+ tlb_flush(env, 1);
+
+ return 0;
+}
+#endif
+
void cpu_exec_init(CPUState *env)
{
CPUState **penv;
@@ -459,6 +486,8 @@ void cpu_exec_init(CPUState *env)
env->nb_watchpoints = 0;
*penv = env;
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
+ register_savevm("cpu_common", cpu_index, CPU_COMMON_SAVE_VERSION,
+ cpu_common_save, cpu_common_load, env);
register_savevm("cpu", cpu_index, CPU_SAVE_VERSION,
cpu_save, cpu_load, env);
#endif