2 * Internal execution defines for qemu
4 * Copyright (c) 2003 Fabrice Bellard
6 * SPDX-License-Identifier: LGPL-2.1-or-later
9 #ifndef ACCEL_TCG_INTERNAL_H
10 #define ACCEL_TCG_INTERNAL_H
12 #include "exec/exec-all.h"
15 * Access to the various translations structures need to be serialised
16 * via locks for consistency. In user-mode emulation access to the
17 * memory related structures are protected with mmap_lock.
18 * In !user-mode we use per-page locks.
21 #define assert_memory_lock()
23 #define assert_memory_lock() tcg_debug_assert(have_mmap_lock())
26 #if defined(CONFIG_SOFTMMU) && defined(CONFIG_DEBUG_TCG)
27 void assert_no_pages_locked(void);
29 static inline void assert_no_pages_locked(void) { }
32 #ifdef CONFIG_USER_ONLY
33 static inline void page_table_config_init(void) { }
35 void page_table_config_init(void);
39 void tb_invalidate_phys_range_fast(ram_addr_t ram_addr
,
42 G_NORETURN
void cpu_io_recompile(CPUState
*cpu
, uintptr_t retaddr
);
43 #endif /* CONFIG_SOFTMMU */
45 TranslationBlock
*tb_gen_code(CPUState
*cpu
, target_ulong pc
,
46 target_ulong cs_base
, uint32_t flags
,
49 void tb_htable_init(void);
50 void tb_reset_jump(TranslationBlock
*tb
, int n
);
51 TranslationBlock
*tb_link_page(TranslationBlock
*tb
, tb_page_addr_t phys_pc
,
52 tb_page_addr_t phys_page2
);
53 bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr
, uintptr_t pc
);
54 void cpu_restore_state_from_tb(CPUState
*cpu
, TranslationBlock
*tb
,
57 /* Return the current PC from CPU, which may be cached in TB. */
58 static inline target_ulong
log_pc(CPUState
*cpu
, const TranslationBlock
*tb
)
60 if (tb_cflags(tb
) & CF_PCREL
) {
61 return cpu
->cc
->get_pc(cpu
);
67 extern int64_t max_delay
;
68 extern int64_t max_advance
;
70 #endif /* ACCEL_TCG_INTERNAL_H */