aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'accel/tcg/internal.h')
-rw-r--r--accel/tcg/internal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index 3092bfa964..dc800fd485 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -18,4 +18,14 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
void page_init(void);
void tb_htable_init(void);
+/* Return the current PC from CPU, which may be cached in TB. */
+static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb)
+{
+#if TARGET_TB_PCREL
+ return cpu->cc->get_pc(cpu);
+#else
+ return tb_pc(tb);
+#endif
+}
+
#endif /* ACCEL_TCG_INTERNAL_H */