Revision bf1b03fe
b/target-alpha/translate.c | ||
---|---|---|
147 | 147 |
done_init = 1; |
148 | 148 |
} |
149 | 149 |
|
150 |
static ExitStatus gen_excp(DisasContext *ctx, int exception, int error_code)
|
|
150 |
static void gen_excp_1(int exception, int error_code)
|
|
151 | 151 |
{ |
152 | 152 |
TCGv_i32 tmp1, tmp2; |
153 | 153 |
|
154 |
tcg_gen_movi_i64(cpu_pc, ctx->pc); |
|
155 | 154 |
tmp1 = tcg_const_i32(exception); |
156 | 155 |
tmp2 = tcg_const_i32(error_code); |
157 | 156 |
gen_helper_excp(tmp1, tmp2); |
158 | 157 |
tcg_temp_free_i32(tmp2); |
159 | 158 |
tcg_temp_free_i32(tmp1); |
159 |
} |
|
160 | 160 |
|
161 |
static ExitStatus gen_excp(DisasContext *ctx, int exception, int error_code) |
|
162 |
{ |
|
163 |
tcg_gen_movi_i64(cpu_pc, ctx->pc); |
|
164 |
gen_excp_1(exception, error_code); |
|
161 | 165 |
return EXIT_NORETURN; |
162 | 166 |
} |
163 | 167 |
|
... | ... | |
3211 | 3215 |
ctx.pc += 4; |
3212 | 3216 |
ret = translate_one(ctxp, insn); |
3213 | 3217 |
|
3214 |
if (ret == NO_EXIT) { |
|
3215 |
/* If we reach a page boundary, are single stepping, |
|
3216 |
or exhaust instruction count, stop generation. */ |
|
3217 |
if (env->singlestep_enabled) { |
|
3218 |
gen_excp(&ctx, EXCP_DEBUG, 0); |
|
3219 |
ret = EXIT_PC_UPDATED; |
|
3220 |
} else if ((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0 |
|
3221 |
|| gen_opc_ptr >= gen_opc_end |
|
3222 |
|| num_insns >= max_insns |
|
3223 |
|| singlestep) { |
|
3224 |
ret = EXIT_PC_STALE; |
|
3225 |
} |
|
3218 |
/* If we reach a page boundary, are single stepping, |
|
3219 |
or exhaust instruction count, stop generation. */ |
|
3220 |
if (ret == NO_EXIT |
|
3221 |
&& ((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0 |
|
3222 |
|| gen_opc_ptr >= gen_opc_end |
|
3223 |
|| num_insns >= max_insns |
|
3224 |
|| singlestep |
|
3225 |
|| env->singlestep_enabled)) { |
|
3226 |
ret = EXIT_PC_STALE; |
|
3226 | 3227 |
} |
3227 | 3228 |
} while (ret == NO_EXIT); |
3228 | 3229 |
|
... | ... | |
3238 | 3239 |
tcg_gen_movi_i64(cpu_pc, ctx.pc); |
3239 | 3240 |
/* FALLTHRU */ |
3240 | 3241 |
case EXIT_PC_UPDATED: |
3241 |
tcg_gen_exit_tb(0); |
|
3242 |
if (env->singlestep_enabled) { |
|
3243 |
gen_excp_1(EXCP_DEBUG, 0); |
|
3244 |
} else { |
|
3245 |
tcg_gen_exit_tb(0); |
|
3246 |
} |
|
3242 | 3247 |
break; |
3243 | 3248 |
default: |
3244 | 3249 |
abort(); |
Also available in: Unified diff