From 6b9175478e9ad8ef2a9569fd8e2a83440747aae5 Mon Sep 17 00:00:00 2001 From: aliguori Date: Tue, 18 Nov 2008 19:46:41 +0000 Subject: Refactor translation block CPU state handling (Jan Kiszka) This patch refactors the way the CPU state is handled that is associated with a TB. The basic motivation is to move more arch specific code out of generic files. Specifically the long #ifdef clutter in tb_find_fast() has to be overcome in order to avoid duplicating it for the gdb watchpoint fixes (patch "Restore pc on watchpoint hits"). Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5736 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-i386/cpu.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'target-i386/cpu.h') diff --git a/target-i386/cpu.h b/target-i386/cpu.h index ead073c..ebbf1b1 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -799,4 +799,12 @@ static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb) env->eip = tb->pc - tb->cs_base; } +static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, + target_ulong *cs_base, int *flags) +{ + *cs_base = env->segs[R_CS].base; + *pc = *cs_base + env->eip; + *flags = env->hflags | (env->eflags & (IOPL_MASK | TF_MASK | VM_MASK)); +} + #endif /* CPU_I386_H */ -- cgit v1.1