aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-28 20:20:53 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-28 20:20:53 +0000
commitc5be9f0898b92d0d6bfb458fd50fc170f4300361 (patch)
treecbb92f2077a774f0864c02f508ce16084ce88a6e /exec.c
parent130751ee24a5ec8d417fa063d3d956c54fea2033 (diff)
Fix CPU chaining in linux-user emulation, by Gwenole Beauchesne.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2459 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 2e09b4bc3e..37d58a43ea 100644
--- a/exec.c
+++ b/exec.c
@@ -1222,6 +1222,18 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
abort();
}
+CPUState *cpu_copy(CPUState *env)
+{
+ CPUState *new_env = cpu_init();
+ /* preserve chaining and index */
+ CPUState *next_cpu = new_env->next_cpu;
+ int cpu_index = new_env->cpu_index;
+ memcpy(new_env, env, sizeof(CPUState));
+ new_env->next_cpu = next_cpu;
+ new_env->cpu_index = cpu_index;
+ return new_env;
+}
+
#if !defined(CONFIG_USER_ONLY)
/* NOTE: if flush_global is true, also flush global entries (not