• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision1c3c8af1fb40a481c07749e0448644d9b7700415 (tree)
l'heure2015-09-12 00:16:16
AuteurPavel Dovgalyuk <Pavel.Dovgaluk@ispr...>
CommiterRichard Henderson

Message de Log

cpu-exec: introduce loop exit with restore function

This patch introduces loop exit function, which also
restores guest CPU state according to the value of host
program counter.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150710095702.13280.97477.stgit@PASHA-ISP>
Signed-off-by: Richard Henderson <rth@twiddle.net>

Change Summary

Modification

--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -134,6 +134,15 @@ void cpu_loop_exit(CPUState *cpu)
134134 siglongjmp(cpu->jmp_env, 1);
135135 }
136136
137+void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc)
138+{
139+ if (pc) {
140+ cpu_restore_state(cpu, pc);
141+ }
142+ cpu->current_tb = NULL;
143+ siglongjmp(cpu->jmp_env, 1);
144+}
145+
137146 /* exit the current TB from a signal handler. The host registers are
138147 restored in a state compatible with the CPU emulator
139148 */
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -90,6 +90,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
9090 int cflags);
9191 void cpu_exec_init(CPUState *cpu, Error **errp);
9292 void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
93+void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
9394
9495 #if !defined(CONFIG_USER_ONLY)
9596 bool qemu_in_vcpu_thread(void);