]> git.proxmox.com Git - qemu.git/blobdiff - target-sh4/cpu.h
Refactor translation block CPU state handling (Jan Kiszka)
[qemu.git] / target-sh4 / cpu.h
index ed7c1054cd8ad167eaa26b90d43bcc6376b79df8..23ecded55fbb1722e4de647de388dc68f1ed0e83 100644 (file)
@@ -271,4 +271,15 @@ static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
     env->flags = tb->flags;
 }
 
+static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
+                                        target_ulong *cs_base, int *flags)
+{
+    *pc = env->pc;
+    *cs_base = 0;
+    *flags = (env->flags & (DELAY_SLOT | DELAY_SLOT_CONDITIONAL
+                    | DELAY_SLOT_TRUE | DELAY_SLOT_CLEARME))   /* Bits  0- 3 */
+            | (env->fpscr & (FPSCR_FR | FPSCR_SZ | FPSCR_PR))  /* Bits 19-21 */
+            | (env->sr & (SR_MD | SR_RB));                     /* Bits 29-30 */
+}
+
 #endif                         /* _CPU_SH4_H */