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
This commit is contained in:
pbrook 2008-07-01 20:01:19 +00:00
parent a5cdf95220
commit 9656f324d2
12 changed files with 38 additions and 28 deletions

29
exec.c
View file

@ -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