Revision 93fcfe39 target-ppc/translate.c
b/target-ppc/translate.c | ||
---|---|---|
43 | 43 |
//#define DO_PPC_STATISTICS |
44 | 44 |
|
45 | 45 |
#ifdef PPC_DEBUG_DISAS |
46 |
# define LOG_DISAS(...) do { \ |
|
47 |
if (loglevel & CPU_LOG_TB_IN_ASM) \ |
|
48 |
fprintf(logfile, ## __VA_ARGS__); \ |
|
49 |
} while (0) |
|
46 |
# define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) |
|
50 | 47 |
#else |
51 | 48 |
# define LOG_DISAS(...) do { } while (0) |
52 | 49 |
#endif |
... | ... | |
3900 | 3897 |
* allowing userland application to read the PVR |
3901 | 3898 |
*/ |
3902 | 3899 |
if (sprn != SPR_PVR) { |
3903 |
if (loglevel != 0) { |
|
3904 |
fprintf(logfile, "Trying to read privileged spr %d %03x at " |
|
3900 |
qemu_log("Trying to read privileged spr %d %03x at " |
|
3905 | 3901 |
ADDRX "\n", sprn, sprn, ctx->nip); |
3906 |
} |
|
3907 | 3902 |
printf("Trying to read privileged spr %d %03x at " ADDRX "\n", |
3908 | 3903 |
sprn, sprn, ctx->nip); |
3909 | 3904 |
} |
... | ... | |
3911 | 3906 |
} |
3912 | 3907 |
} else { |
3913 | 3908 |
/* Not defined */ |
3914 |
if (loglevel != 0) { |
|
3915 |
fprintf(logfile, "Trying to read invalid spr %d %03x at " |
|
3909 |
qemu_log("Trying to read invalid spr %d %03x at " |
|
3916 | 3910 |
ADDRX "\n", sprn, sprn, ctx->nip); |
3917 |
} |
|
3918 | 3911 |
printf("Trying to read invalid spr %d %03x at " ADDRX "\n", |
3919 | 3912 |
sprn, sprn, ctx->nip); |
3920 | 3913 |
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR); |
... | ... | |
4046 | 4039 |
(*write_cb)(ctx, sprn, rS(ctx->opcode)); |
4047 | 4040 |
} else { |
4048 | 4041 |
/* Privilege exception */ |
4049 |
if (loglevel != 0) { |
|
4050 |
fprintf(logfile, "Trying to write privileged spr %d %03x at " |
|
4042 |
qemu_log("Trying to write privileged spr %d %03x at " |
|
4051 | 4043 |
ADDRX "\n", sprn, sprn, ctx->nip); |
4052 |
} |
|
4053 | 4044 |
printf("Trying to write privileged spr %d %03x at " ADDRX "\n", |
4054 | 4045 |
sprn, sprn, ctx->nip); |
4055 | 4046 |
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); |
4056 | 4047 |
} |
4057 | 4048 |
} else { |
4058 | 4049 |
/* Not defined */ |
4059 |
if (loglevel != 0) { |
|
4060 |
fprintf(logfile, "Trying to write invalid spr %d %03x at " |
|
4050 |
qemu_log("Trying to write invalid spr %d %03x at " |
|
4061 | 4051 |
ADDRX "\n", sprn, sprn, ctx->nip); |
4062 |
} |
|
4063 | 4052 |
printf("Trying to write invalid spr %d %03x at " ADDRX "\n", |
4064 | 4053 |
sprn, sprn, ctx->nip); |
4065 | 4054 |
gen_inval_exception(ctx, POWERPC_EXCP_INVAL_SPR); |
... | ... | |
8267 | 8256 |
} |
8268 | 8257 |
/* Is opcode *REALLY* valid ? */ |
8269 | 8258 |
if (unlikely(handler->handler == &gen_invalid)) { |
8270 |
if (loglevel != 0) {
|
|
8271 |
fprintf(logfile, "invalid/unsupported opcode: "
|
|
8272 |
"%02x - %02x - %02x (%08x) " ADDRX " %d\n", |
|
8273 |
opc1(ctx.opcode), opc2(ctx.opcode), |
|
8274 |
opc3(ctx.opcode), ctx.opcode, ctx.nip - 4, (int)msr_ir); |
|
8259 |
if (qemu_log_enabled()) {
|
|
8260 |
qemu_log("invalid/unsupported opcode: "
|
|
8261 |
"%02x - %02x - %02x (%08x) " ADDRX " %d\n",
|
|
8262 |
opc1(ctx.opcode), opc2(ctx.opcode),
|
|
8263 |
opc3(ctx.opcode), ctx.opcode, ctx.nip - 4, (int)msr_ir);
|
|
8275 | 8264 |
} else { |
8276 | 8265 |
printf("invalid/unsupported opcode: " |
8277 | 8266 |
"%02x - %02x - %02x (%08x) " ADDRX " %d\n", |
... | ... | |
8280 | 8269 |
} |
8281 | 8270 |
} else { |
8282 | 8271 |
if (unlikely((ctx.opcode & handler->inval) != 0)) { |
8283 |
if (loglevel != 0) {
|
|
8284 |
fprintf(logfile, "invalid bits: %08x for opcode: "
|
|
8285 |
"%02x - %02x - %02x (%08x) " ADDRX "\n", |
|
8286 |
ctx.opcode & handler->inval, opc1(ctx.opcode), |
|
8287 |
opc2(ctx.opcode), opc3(ctx.opcode), |
|
8288 |
ctx.opcode, ctx.nip - 4); |
|
8272 |
if (qemu_log_enabled()) {
|
|
8273 |
qemu_log("invalid bits: %08x for opcode: "
|
|
8274 |
"%02x - %02x - %02x (%08x) " ADDRX "\n",
|
|
8275 |
ctx.opcode & handler->inval, opc1(ctx.opcode),
|
|
8276 |
opc2(ctx.opcode), opc3(ctx.opcode),
|
|
8277 |
ctx.opcode, ctx.nip - 4);
|
|
8289 | 8278 |
} else { |
8290 | 8279 |
printf("invalid bits: %08x for opcode: " |
8291 | 8280 |
"%02x - %02x - %02x (%08x) " ADDRX "\n", |
... | ... | |
8343 | 8332 |
tb->icount = num_insns; |
8344 | 8333 |
} |
8345 | 8334 |
#if defined(DEBUG_DISAS) |
8346 |
if (loglevel & CPU_LOG_TB_CPU) { |
|
8347 |
fprintf(logfile, "---------------- excp: %04x\n", ctx.exception); |
|
8348 |
cpu_dump_state(env, logfile, fprintf, 0); |
|
8349 |
} |
|
8335 |
qemu_log_mask(CPU_LOG_TB_CPU, "---------------- excp: %04x\n", ctx.exception); |
|
8336 |
log_cpu_state_mask(CPU_LOG_TB_CPU, env, 0); |
|
8350 | 8337 |
if (loglevel & CPU_LOG_TB_IN_ASM) { |
8351 | 8338 |
int flags; |
8352 | 8339 |
flags = env->bfd_mach; |
8353 | 8340 |
flags |= ctx.le_mode << 16; |
8354 |
fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start));
|
|
8355 |
target_disas(logfile, pc_start, ctx.nip - pc_start, flags);
|
|
8356 |
fprintf(logfile, "\n");
|
|
8341 |
qemu_log("IN: %s\n", lookup_symbol(pc_start));
|
|
8342 |
log_target_disas(pc_start, ctx.nip - pc_start, flags);
|
|
8343 |
qemu_log("\n");
|
|
8357 | 8344 |
} |
8358 | 8345 |
#endif |
8359 | 8346 |
} |
Also available in: Unified diff