mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 06:25:12 +00:00
tb: consistently use uint32_t for tb->flags
We are inconsistent with the type of tb->flags: usage varies loosely between int and uint64_t. Settle to uint32_t everywhere, which is superior to both: at least one target (aarch64) uses the most significant bit in the u32, and uint64_t is wasteful. Compile-tested for all targets. Backports commit 89fee74a0f066dfd73830a7b5fa137e87888c870 from qemu
This commit is contained in:
parent
fe2000aa32
commit
170f6e0b3b
|
@ -388,7 +388,7 @@ static TranslationBlock *tb_find_fast(CPUState *cpu)
|
|||
CPUArchState *env = (CPUArchState *)cpu->env_ptr;
|
||||
TranslationBlock *tb;
|
||||
target_ulong cs_base, pc;
|
||||
int flags;
|
||||
uint32_t flags;
|
||||
|
||||
/* we record a subset of the CPU state. It will
|
||||
always be the same before a given translated block
|
||||
|
|
|
@ -74,7 +74,8 @@ void QEMU_NORETURN cpu_resume_from_signal(CPUState *cpu, void *puc);
|
|||
|
||||
void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
|
||||
TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||
target_ulong pc, target_ulong cs_base, int flags,
|
||||
target_ulong pc, target_ulong cs_base,
|
||||
uint32_t flags,
|
||||
int cflags);
|
||||
void cpu_exec_init(CPUState *env, void *opaque);
|
||||
|
||||
|
@ -235,7 +236,7 @@ static inline void tlb_flush_by_mmuidx(CPUState *cpu, ...)
|
|||
struct TranslationBlock {
|
||||
target_ulong pc; /* simulated PC corresponding to this block (EIP + CS base) */
|
||||
target_ulong cs_base; /* CS base for this block */
|
||||
uint64_t flags; /* flags defining in which context the code was generated */
|
||||
uint32_t flags; /* flags defining in which context the code was generated */
|
||||
uint16_t size; /* size of target code for this block (1 <=
|
||||
size <= TARGET_PAGE_SIZE) */
|
||||
uint16_t icount;
|
||||
|
|
|
@ -2129,7 +2129,7 @@ static inline bool arm_cpu_data_is_big_endian(CPUARMState *env)
|
|||
}
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc,
|
||||
target_ulong *cs_base, int *flags)
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
{
|
||||
if (is_a64(env)) {
|
||||
*pc = env->pc;
|
||||
|
|
|
@ -1266,7 +1266,7 @@ void tcg_x86_init(struct uc_struct *);
|
|||
#include "exec/exec-all.h"
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUX86State *env, target_ulong *pc,
|
||||
target_ulong *cs_base, int *flags)
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
{
|
||||
*cs_base = env->segs[R_CS].base;
|
||||
*pc = *cs_base + env->eip;
|
||||
|
|
|
@ -8948,7 +8948,7 @@ void gen_intermediate_code(CPUX86State *env, TranslationBlock *tb)
|
|||
TCGContext *tcg_ctx = env->uc->tcg_ctx;
|
||||
DisasContext dc1, *dc = &dc1;
|
||||
target_ulong pc_ptr;
|
||||
uint64_t flags;
|
||||
uint32_t flags;
|
||||
target_ulong pc_start;
|
||||
target_ulong cs_base;
|
||||
int num_insns = 0;
|
||||
|
|
|
@ -240,7 +240,7 @@ int m68k_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
|
|||
#include "exec/cpu-all.h"
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUM68KState *env, target_ulong *pc,
|
||||
target_ulong *cs_base, int *flags)
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
{
|
||||
*pc = env->pc;
|
||||
*cs_base = 0;
|
||||
|
|
|
@ -837,7 +837,7 @@ static inline void restore_pamask(CPUMIPSState *env)
|
|||
}
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc,
|
||||
target_ulong *cs_base, int *flags)
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
{
|
||||
*pc = env->active_tc.PC;
|
||||
*cs_base = 0;
|
||||
|
|
|
@ -697,7 +697,7 @@ trap_state* cpu_tsptr(CPUSPARCState* env);
|
|||
#define TB_FLAG_AM_ENABLED (1 << 5)
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, target_ulong *pc,
|
||||
target_ulong *cs_base, int *flags)
|
||||
target_ulong *cs_base, uint32_t *flags)
|
||||
{
|
||||
*pc = env->pc;
|
||||
*cs_base = env->npc;
|
||||
|
|
|
@ -1159,7 +1159,7 @@ static void build_page_bitmap(PageDesc *p)
|
|||
|
||||
TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||
target_ulong pc, target_ulong cs_base,
|
||||
int flags, int cflags) // qq
|
||||
uint32_t flags, int cflags)
|
||||
{
|
||||
CPUArchState *env = cpu->env_ptr;
|
||||
TCGContext *tcg_ctx = env->uc->tcg_ctx;
|
||||
|
@ -1320,7 +1320,7 @@ void tb_invalidate_phys_page_range(struct uc_struct *uc, tb_page_addr_t start, t
|
|||
int current_tb_modified = 0;
|
||||
target_ulong current_pc = 0;
|
||||
target_ulong current_cs_base = 0;
|
||||
int current_flags = 0;
|
||||
uint32_t current_flags = 0;
|
||||
#endif /* TARGET_HAS_PRECISE_SMC */
|
||||
|
||||
p = page_find(uc, start >> TARGET_PAGE_BITS);
|
||||
|
@ -1427,7 +1427,7 @@ static void tb_invalidate_phys_page(struct uc_struct *uc, tb_page_addr_t addr,
|
|||
int current_tb_modified = 0;
|
||||
target_ulong current_pc = 0;
|
||||
target_ulong current_cs_base = 0;
|
||||
int current_flags = 0;
|
||||
uint32_t current_flags = 0;
|
||||
#endif
|
||||
|
||||
addr &= TARGET_PAGE_MASK;
|
||||
|
@ -1686,7 +1686,7 @@ void tb_check_watchpoint(CPUState *cpu)
|
|||
CPUArchState *env = cpu->env_ptr;
|
||||
target_ulong pc, cs_base;
|
||||
tb_page_addr_t addr;
|
||||
int flags;
|
||||
uint32_t flags;
|
||||
|
||||
cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
|
||||
addr = get_page_addr_code(env, pc);
|
||||
|
@ -1706,7 +1706,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
|
|||
TranslationBlock *tb;
|
||||
uint32_t n, cflags;
|
||||
target_ulong pc, cs_base;
|
||||
uint64_t flags;
|
||||
uint32_t flags;
|
||||
|
||||
tb = tb_find_pc(env->uc, retaddr);
|
||||
if (!tb) {
|
||||
|
|
Loading…
Reference in a new issue