Merge commit 'ad96090a01d848df67d70c5259ed8aa321fa8716' into upstream-merge
[qemu/qemu-dev-zwu.git] / qemu-kvm-helper.c
blob915d664398f2f2f82ad350b4e88d778b81bf96d6
2 #include "config.h"
3 #include "config-host.h"
5 #include "exec.h"
7 #include "qemu-kvm.h"
9 void qemu_kvm_call_with_env(void (*func)(void *), void *data, CPUState *newenv)
11 host_reg_t saved_env_reg;
12 CPUState *oldenv;
14 oldenv = newenv;
16 saved_env_reg = (host_reg_t) env;
17 env = newenv;
19 func(data);
21 env = oldenv;
22 asm("");
23 env = (void *) saved_env_reg;
26 static void call_helper_cpuid(void *junk)
28 helper_cpuid();
31 void qemu_kvm_cpuid_on_env(CPUState *env)
33 qemu_kvm_call_with_env(call_helper_cpuid, NULL, env);