Skip to content

Commit 8cfd049

Browse files
committed
tcg: Change tcg_gen_exit_tb argument to uintptr_t
And update all users. Reviewed-by: Aurelien Jarno <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 48bc6ba commit 8cfd049

File tree

18 files changed

+25
-25
lines changed

18 files changed

+25
-25
lines changed

Diff for: include/exec/gen-icount.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ static inline void gen_tb_start(void)
3939
static void gen_tb_end(TranslationBlock *tb, int num_insns)
4040
{
4141
gen_set_label(exitreq_label);
42-
tcg_gen_exit_tb((tcg_target_long)tb + TB_EXIT_REQUESTED);
42+
tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_REQUESTED);
4343

4444
if (use_icount) {
4545
*icount_arg = num_insns;
4646
gen_set_label(icount_label);
47-
tcg_gen_exit_tb((tcg_target_long)tb + TB_EXIT_ICOUNT_EXPIRED);
47+
tcg_gen_exit_tb((uintptr_t)tb + TB_EXIT_ICOUNT_EXPIRED);
4848
}
4949
}
5050

Diff for: target-alpha/translate.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static ExitStatus gen_bdirect(DisasContext *ctx, int ra, int32_t disp)
415415
} else if (use_goto_tb(ctx, dest)) {
416416
tcg_gen_goto_tb(0);
417417
tcg_gen_movi_i64(cpu_pc, dest);
418-
tcg_gen_exit_tb((tcg_target_long)ctx->tb);
418+
tcg_gen_exit_tb((uintptr_t)ctx->tb);
419419
return EXIT_GOTO_TB;
420420
} else {
421421
tcg_gen_movi_i64(cpu_pc, dest);
@@ -434,12 +434,12 @@ static ExitStatus gen_bcond_internal(DisasContext *ctx, TCGCond cond,
434434

435435
tcg_gen_goto_tb(0);
436436
tcg_gen_movi_i64(cpu_pc, ctx->pc);
437-
tcg_gen_exit_tb((tcg_target_long)ctx->tb);
437+
tcg_gen_exit_tb((uintptr_t)ctx->tb);
438438

439439
gen_set_label(lab_true);
440440
tcg_gen_goto_tb(1);
441441
tcg_gen_movi_i64(cpu_pc, dest);
442-
tcg_gen_exit_tb((tcg_target_long)ctx->tb + 1);
442+
tcg_gen_exit_tb((uintptr_t)ctx->tb + 1);
443443

444444
return EXIT_GOTO_TB;
445445
} else {
@@ -1629,7 +1629,7 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode)
16291629
we change the PAL base register. */
16301630
if (!ctx->singlestep_enabled && !(ctx->tb->cflags & CF_LAST_IO)) {
16311631
tcg_gen_goto_tb(0);
1632-
tcg_gen_exit_tb((tcg_target_long)ctx->tb);
1632+
tcg_gen_exit_tb((uintptr_t)ctx->tb);
16331633
return EXIT_GOTO_TB;
16341634
}
16351635

Diff for: target-arm/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3356,7 +3356,7 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint32_t dest)
33563356
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
33573357
tcg_gen_goto_tb(n);
33583358
gen_set_pc_im(dest);
3359-
tcg_gen_exit_tb((tcg_target_long)tb + n);
3359+
tcg_gen_exit_tb((uintptr_t)tb + n);
33603360
} else {
33613361
gen_set_pc_im(dest);
33623362
tcg_gen_exit_tb(0);

Diff for: target-cris/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
558558
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
559559
tcg_gen_goto_tb(n);
560560
tcg_gen_movi_tl(env_pc, dest);
561-
tcg_gen_exit_tb((tcg_target_long)tb + n);
561+
tcg_gen_exit_tb((uintptr_t)tb + n);
562562
} else {
563563
tcg_gen_movi_tl(env_pc, dest);
564564
tcg_gen_exit_tb(0);

Diff for: target-i386/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2413,7 +2413,7 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip)
24132413
/* jump to same page: we can use a direct jump */
24142414
tcg_gen_goto_tb(tb_num);
24152415
gen_jmp_im(eip);
2416-
tcg_gen_exit_tb((tcg_target_long)tb + tb_num);
2416+
tcg_gen_exit_tb((uintptr_t)tb + tb_num);
24172417
} else {
24182418
/* jump to another page: currently not optimized */
24192419
gen_jmp_im(eip);

Diff for: target-lm32/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
129129
likely(!dc->singlestep_enabled)) {
130130
tcg_gen_goto_tb(n);
131131
tcg_gen_movi_tl(cpu_pc, dest);
132-
tcg_gen_exit_tb((tcg_target_long)tb + n);
132+
tcg_gen_exit_tb((uintptr_t)tb + n);
133133
} else {
134134
tcg_gen_movi_tl(cpu_pc, dest);
135135
if (dc->singlestep_enabled) {

Diff for: target-m68k/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest)
869869
(s->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
870870
tcg_gen_goto_tb(n);
871871
tcg_gen_movi_i32(QREG_PC, dest);
872-
tcg_gen_exit_tb((tcg_target_long)tb + n);
872+
tcg_gen_exit_tb((uintptr_t)tb + n);
873873
} else {
874874
gen_jmp_im(s, dest);
875875
tcg_gen_exit_tb(0);

Diff for: target-microblaze/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
138138
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
139139
tcg_gen_goto_tb(n);
140140
tcg_gen_movi_tl(cpu_SR[SR_PC], dest);
141-
tcg_gen_exit_tb((tcg_target_long)tb + n);
141+
tcg_gen_exit_tb((uintptr_t)tb + n);
142142
} else {
143143
tcg_gen_movi_tl(cpu_SR[SR_PC], dest);
144144
tcg_gen_exit_tb(0);

Diff for: target-mips/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3581,7 +3581,7 @@ static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
35813581
likely(!ctx->singlestep_enabled)) {
35823582
tcg_gen_goto_tb(n);
35833583
gen_save_pc(dest);
3584-
tcg_gen_exit_tb((tcg_target_long)tb + n);
3584+
tcg_gen_exit_tb((uintptr_t)tb + n);
35853585
} else {
35863586
gen_save_pc(dest);
35873587
if (ctx->singlestep_enabled) {

Diff for: target-moxie/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static inline void gen_goto_tb(CPUMoxieState *env, DisasContext *ctx,
135135
!ctx->singlestep_enabled) {
136136
tcg_gen_goto_tb(n);
137137
tcg_gen_movi_i32(cpu_pc, dest);
138-
tcg_gen_exit_tb((tcg_target_long)tb + n);
138+
tcg_gen_exit_tb((uintptr_t)tb + n);
139139
} else {
140140
tcg_gen_movi_i32(cpu_pc, dest);
141141
if (ctx->singlestep_enabled) {

Diff for: target-openrisc/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
198198
likely(!dc->singlestep_enabled)) {
199199
tcg_gen_movi_tl(cpu_pc, dest);
200200
tcg_gen_goto_tb(n);
201-
tcg_gen_exit_tb((tcg_target_long)tb + n);
201+
tcg_gen_exit_tb((uintptr_t)tb + n);
202202
} else {
203203
tcg_gen_movi_tl(cpu_pc, dest);
204204
if (dc->singlestep_enabled) {

Diff for: target-ppc/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3551,7 +3551,7 @@ static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
35513551
likely(!ctx->singlestep_enabled)) {
35523552
tcg_gen_goto_tb(n);
35533553
tcg_gen_movi_tl(cpu_nip, dest & ~3);
3554-
tcg_gen_exit_tb((tcg_target_long)tb + n);
3554+
tcg_gen_exit_tb((uintptr_t)tb + n);
35553555
} else {
35563556
tcg_gen_movi_tl(cpu_nip, dest & ~3);
35573557
if (unlikely(ctx->singlestep_enabled)) {

Diff for: target-s390x/translate.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ static ExitStatus help_goto_direct(DisasContext *s, uint64_t dest)
11691169
update_cc_op(s);
11701170
tcg_gen_goto_tb(0);
11711171
tcg_gen_movi_i64(psw_addr, dest);
1172-
tcg_gen_exit_tb((tcg_target_long)s->tb);
1172+
tcg_gen_exit_tb((uintptr_t)s->tb);
11731173
return EXIT_GOTO_TB;
11741174
} else {
11751175
tcg_gen_movi_i64(psw_addr, dest);
@@ -1227,13 +1227,13 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c,
12271227
/* Branch not taken. */
12281228
tcg_gen_goto_tb(0);
12291229
tcg_gen_movi_i64(psw_addr, s->next_pc);
1230-
tcg_gen_exit_tb((tcg_target_long)s->tb + 0);
1230+
tcg_gen_exit_tb((uintptr_t)s->tb + 0);
12311231

12321232
/* Branch taken. */
12331233
gen_set_label(lab);
12341234
tcg_gen_goto_tb(1);
12351235
tcg_gen_movi_i64(psw_addr, dest);
1236-
tcg_gen_exit_tb((tcg_target_long)s->tb + 1);
1236+
tcg_gen_exit_tb((uintptr_t)s->tb + 1);
12371237

12381238
ret = EXIT_GOTO_TB;
12391239
} else {
@@ -1256,7 +1256,7 @@ static ExitStatus help_branch(DisasContext *s, DisasCompare *c,
12561256
update_cc_op(s);
12571257
tcg_gen_goto_tb(0);
12581258
tcg_gen_movi_i64(psw_addr, s->next_pc);
1259-
tcg_gen_exit_tb((tcg_target_long)s->tb + 0);
1259+
tcg_gen_exit_tb((uintptr_t)s->tb + 0);
12601260

12611261
gen_set_label(lab);
12621262
if (is_imm) {

Diff for: target-sh4/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest)
186186
/* Use a direct jump if in same page and singlestep not enabled */
187187
tcg_gen_goto_tb(n);
188188
tcg_gen_movi_i32(cpu_pc, dest);
189-
tcg_gen_exit_tb((tcg_target_long)tb + n);
189+
tcg_gen_exit_tb((uintptr_t)tb + n);
190190
} else {
191191
tcg_gen_movi_i32(cpu_pc, dest);
192192
if (ctx->singlestep_enabled)

Diff for: target-sparc/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num,
322322
tcg_gen_goto_tb(tb_num);
323323
tcg_gen_movi_tl(cpu_pc, pc);
324324
tcg_gen_movi_tl(cpu_npc, npc);
325-
tcg_gen_exit_tb((tcg_target_long)tb + tb_num);
325+
tcg_gen_exit_tb((uintptr_t)tb + tb_num);
326326
} else {
327327
/* jump to another page: currently not optimized */
328328
tcg_gen_movi_tl(cpu_pc, pc);

Diff for: target-unicore32/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint32_t dest)
11001100
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
11011101
tcg_gen_goto_tb(n);
11021102
gen_set_pc_im(dest);
1103-
tcg_gen_exit_tb((tcg_target_long)tb + n);
1103+
tcg_gen_exit_tb((uintptr_t)tb + n);
11041104
} else {
11051105
gen_set_pc_im(dest);
11061106
tcg_gen_exit_tb(0);

Diff for: target-xtensa/translate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static void gen_jump_slot(DisasContext *dc, TCGv dest, int slot)
400400
} else {
401401
if (slot >= 0) {
402402
tcg_gen_goto_tb(slot);
403-
tcg_gen_exit_tb((tcg_target_long)dc->tb + slot);
403+
tcg_gen_exit_tb((uintptr_t)dc->tb + slot);
404404
} else {
405405
tcg_gen_exit_tb(0);
406406
}

Diff for: tcg/tcg-op.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,7 @@ static inline void tcg_gen_debug_insn_start(uint64_t pc)
26312631
#endif
26322632
}
26332633

2634-
static inline void tcg_gen_exit_tb(tcg_target_long val)
2634+
static inline void tcg_gen_exit_tb(uintptr_t val)
26352635
{
26362636
tcg_gen_op1i(INDEX_op_exit_tb, val);
26372637
}

0 commit comments

Comments
 (0)