Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Dec 12, 2024
1 parent d492626 commit 6391f77
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion accel/tcg/cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void tb_set_jmp_target(TranslationBlock *tb, int n, uintptr_t addr)
uintptr_t jmp_rw = jmp_rx - tcg_splitwx_diff;

tb->jmp_target_addr[n] = addr;
tb_target_set_jmp_target(c_tb, n, jmp_rx, _MK_ATOMIC((int32_t *)jmp_rw));
tb_target_set_jmp_target(c_tb, n, jmp_rx, _MK_ATOMIC((tcg_insn_unit *)jmp_rw));
}

static inline void tb_add_jump(TranslationBlock *tb, int n,
Expand Down
2 changes: 1 addition & 1 deletion include/tcg/tcg.h
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ void tcg_func_start(TCGContext *s);
int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start);

void tb_target_set_jmp_target(const TranslationBlock *, int,
uintptr_t, _Atomic(int32_t) *);
uintptr_t, _Atomic(tcg_insn_unit) *);

void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size);

Expand Down
6 changes: 3 additions & 3 deletions tcg/aarch64/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,7 @@ static void tcg_out_goto_tb(TCGContext *s, int which)
}

void tb_target_set_jmp_target(const TranslationBlock *tb, int n,
uintptr_t jmp_rx, uintptr_t jmp_rw)
uintptr_t jmp_rx, _Atomic(tcg_insn_unit) *jmp_rw)
{
uintptr_t d_addr = tb->jmp_target_addr[n];
ptrdiff_t d_offset = d_addr - jmp_rx;
Expand All @@ -2100,8 +2100,8 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n,
/* Note that we asserted this in range in tcg_out_goto_tb. */
insn = deposit32(I3305_LDR | TCG_REG_TMP0, 5, 19, i_offset >> 2);
}
qatomic_set((uint32_t *)jmp_rw, insn);
flush_idcache_range(jmp_rx, jmp_rw, 4);
qatomic_set(jmp_rw, insn);
flush_idcache_range(jmp_rx, (uintptr_t)((void *)jmp_rw), 4);
}

static void tcg_out_op(TCGContext *s, TCGOpcode opc,
Expand Down
6 changes: 3 additions & 3 deletions tcg/arm/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ static void tcg_out_goto_tb(TCGContext *s, int which)
}

void tb_target_set_jmp_target(const TranslationBlock *tb, int n,
uintptr_t jmp_rx, uintptr_t jmp_rw)
uintptr_t jmp_rx, _Atomic(tcg_insn_unit) *jmp_rw)
{
uintptr_t addr = tb->jmp_target_addr[n];
ptrdiff_t offset = addr - (jmp_rx + 8);
Expand All @@ -1795,8 +1795,8 @@ void tb_target_set_jmp_target(const TranslationBlock *tb, int n,
insn = INSN_NOP;
}

qatomic_set((uint32_t *)jmp_rw, insn);
flush_idcache_range(jmp_rx, jmp_rw, 4);
qatomic_set(jmp_rw, insn);
flush_idcache_range(jmp_rx, (uintptr_t)((void *)jmp_rw), 4);
}

static void tcg_out_op(TCGContext *s, TCGOpcode opc,
Expand Down
2 changes: 1 addition & 1 deletion tcg/i386/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2587,7 +2587,7 @@ static void tcg_out_goto_tb(TCGContext *s, int which)
}

void tb_target_set_jmp_target(const TranslationBlock *tb, int n,
uintptr_t jmp_rx, _Atomic(int32_t) *jmp_rw)
uintptr_t jmp_rx, _Atomic(tcg_insn_unit) *jmp_rw)
{
/* patch the branch destination */
uintptr_t addr = tb->jmp_target_addr[n];
Expand Down

0 comments on commit 6391f77

Please sign in to comment.