Commit 6b80055dfa4625cad6c0377e0c82ab7fc162c7dd
1 parent
d4082e95
Debug traces fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2721 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
20 additions
and
19 deletions
target-ppc/op_helper.c
... | ... | @@ -189,7 +189,7 @@ void do_store_fpscr (uint32_t mask) |
189 | 189 | |
190 | 190 | target_ulong ppc_load_dump_spr (int sprn) |
191 | 191 | { |
192 | - if (loglevel) { | |
192 | + if (loglevel != 0) { | |
193 | 193 | fprintf(logfile, "Read SPR %d %03x => " ADDRX "\n", |
194 | 194 | sprn, sprn, env->spr[sprn]); |
195 | 195 | } |
... | ... | @@ -199,7 +199,7 @@ target_ulong ppc_load_dump_spr (int sprn) |
199 | 199 | |
200 | 200 | void ppc_store_dump_spr (int sprn, target_ulong val) |
201 | 201 | { |
202 | - if (loglevel) { | |
202 | + if (loglevel != 0) { | |
203 | 203 | fprintf(logfile, "Write SPR %d %03x => " ADDRX " <= " ADDRX "\n", |
204 | 204 | sprn, sprn, env->spr[sprn], val); |
205 | 205 | } |
... | ... | @@ -904,6 +904,7 @@ void do_fcmpo (void) |
904 | 904 | } |
905 | 905 | |
906 | 906 | #if !defined (CONFIG_USER_ONLY) |
907 | +void cpu_dump_rfi (target_ulong RA, target_ulong msr); | |
907 | 908 | void do_rfi (void) |
908 | 909 | { |
909 | 910 | #if defined(TARGET_PPC64) |
... | ... | @@ -919,7 +920,7 @@ void do_rfi (void) |
919 | 920 | do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL)); |
920 | 921 | #endif |
921 | 922 | #if defined (DEBUG_OP) |
922 | - dump_rfi(); | |
923 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
923 | 924 | #endif |
924 | 925 | env->interrupt_request |= CPU_INTERRUPT_EXITTB; |
925 | 926 | } |
... | ... | @@ -935,7 +936,7 @@ void do_rfid (void) |
935 | 936 | do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL)); |
936 | 937 | } |
937 | 938 | #if defined (DEBUG_OP) |
938 | - dump_rfi(); | |
939 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
939 | 940 | #endif |
940 | 941 | env->interrupt_request |= CPU_INTERRUPT_EXITTB; |
941 | 942 | } |
... | ... | @@ -1136,7 +1137,7 @@ void do_POWER_rfsvc (void) |
1136 | 1137 | T0 = env->ctr & 0x0000FFFFUL; |
1137 | 1138 | do_store_msr(env, T0); |
1138 | 1139 | #if defined (DEBUG_OP) |
1139 | - dump_rfi(); | |
1140 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
1140 | 1141 | #endif |
1141 | 1142 | env->interrupt_request |= CPU_INTERRUPT_EXITTB; |
1142 | 1143 | } |
... | ... | @@ -1214,7 +1215,7 @@ void do_40x_rfci (void) |
1214 | 1215 | env->nip = env->spr[SPR_40x_SRR2]; |
1215 | 1216 | do_store_msr(env, env->spr[SPR_40x_SRR3] & ~0xFFFF0000); |
1216 | 1217 | #if defined (DEBUG_OP) |
1217 | - dump_rfi(); | |
1218 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
1218 | 1219 | #endif |
1219 | 1220 | env->interrupt_request = CPU_INTERRUPT_EXITTB; |
1220 | 1221 | } |
... | ... | @@ -1231,7 +1232,7 @@ void do_rfci (void) |
1231 | 1232 | } |
1232 | 1233 | do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_CSRR1] & ~0x3FFF0000); |
1233 | 1234 | #if defined (DEBUG_OP) |
1234 | - dump_rfi(); | |
1235 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
1235 | 1236 | #endif |
1236 | 1237 | env->interrupt_request = CPU_INTERRUPT_EXITTB; |
1237 | 1238 | } |
... | ... | @@ -1248,7 +1249,7 @@ void do_rfdi (void) |
1248 | 1249 | } |
1249 | 1250 | do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_DSRR1] & ~0x3FFF0000); |
1250 | 1251 | #if defined (DEBUG_OP) |
1251 | - dump_rfi(); | |
1252 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
1252 | 1253 | #endif |
1253 | 1254 | env->interrupt_request = CPU_INTERRUPT_EXITTB; |
1254 | 1255 | } |
... | ... | @@ -1265,7 +1266,7 @@ void do_rfmci (void) |
1265 | 1266 | } |
1266 | 1267 | do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_MCSRR1] & ~0x3FFF0000); |
1267 | 1268 | #if defined (DEBUG_OP) |
1268 | - dump_rfi(); | |
1269 | + cpu_dump_rfi(env->nip, do_load_msr(env)); | |
1269 | 1270 | #endif |
1270 | 1271 | env->interrupt_request = CPU_INTERRUPT_EXITTB; |
1271 | 1272 | } |
... | ... | @@ -1275,12 +1276,12 @@ void do_load_dcr (void) |
1275 | 1276 | target_ulong val; |
1276 | 1277 | |
1277 | 1278 | if (unlikely(env->dcr_env == NULL)) { |
1278 | - if (loglevel) { | |
1279 | + if (loglevel != 0) { | |
1279 | 1280 | fprintf(logfile, "No DCR environment\n"); |
1280 | 1281 | } |
1281 | 1282 | do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); |
1282 | 1283 | } else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) { |
1283 | - if (loglevel) { | |
1284 | + if (loglevel != 0) { | |
1284 | 1285 | fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0); |
1285 | 1286 | } |
1286 | 1287 | do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); |
... | ... | @@ -1292,12 +1293,12 @@ void do_load_dcr (void) |
1292 | 1293 | void do_store_dcr (void) |
1293 | 1294 | { |
1294 | 1295 | if (unlikely(env->dcr_env == NULL)) { |
1295 | - if (loglevel) { | |
1296 | + if (loglevel != 0) { | |
1296 | 1297 | fprintf(logfile, "No DCR environment\n"); |
1297 | 1298 | } |
1298 | 1299 | do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); |
1299 | 1300 | } else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) { |
1300 | - if (loglevel) { | |
1301 | + if (loglevel != 0) { | |
1301 | 1302 | fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0); |
1302 | 1303 | } |
1303 | 1304 | do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); |
... | ... | @@ -2515,7 +2516,7 @@ void do_4xx_tlbwe_hi (void) |
2515 | 2516 | target_ulong page, end; |
2516 | 2517 | |
2517 | 2518 | #if defined (DEBUG_SOFTWARE_TLB) |
2518 | - if (loglevel) { | |
2519 | + if (loglevel != 0) { | |
2519 | 2520 | fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1); |
2520 | 2521 | } |
2521 | 2522 | #endif |
... | ... | @@ -2525,7 +2526,7 @@ void do_4xx_tlbwe_hi (void) |
2525 | 2526 | if (tlb->prot & PAGE_VALID) { |
2526 | 2527 | end = tlb->EPN + tlb->size; |
2527 | 2528 | #if defined (DEBUG_SOFTWARE_TLB) |
2528 | - if (loglevel) { | |
2529 | + if (loglevel != 0) { | |
2529 | 2530 | fprintf(logfile, "%s: invalidate old TLB %d start " ADDRX |
2530 | 2531 | " end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end); |
2531 | 2532 | } |
... | ... | @@ -2568,7 +2569,7 @@ void do_4xx_tlbwe_hi (void) |
2568 | 2569 | if (tlb->prot & PAGE_VALID) { |
2569 | 2570 | end = tlb->EPN + tlb->size; |
2570 | 2571 | #if defined (DEBUG_SOFTWARE_TLB) |
2571 | - if (loglevel) { | |
2572 | + if (loglevel != 0) { | |
2572 | 2573 | fprintf(logfile, "%s: invalidate TLB %d start " ADDRX |
2573 | 2574 | " end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end); |
2574 | 2575 | } |
... | ... | @@ -2583,7 +2584,7 @@ void do_4xx_tlbwe_lo (void) |
2583 | 2584 | ppcemb_tlb_t *tlb; |
2584 | 2585 | |
2585 | 2586 | #if defined (DEBUG_SOFTWARE_TLB) |
2586 | - if (loglevel) { | |
2587 | + if (loglevel != 0) { | |
2587 | 2588 | fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1); |
2588 | 2589 | } |
2589 | 2590 | #endif |
... | ... | @@ -2596,8 +2597,8 @@ void do_4xx_tlbwe_lo (void) |
2596 | 2597 | if (T1 & 0x100) |
2597 | 2598 | tlb->prot |= PAGE_WRITE; |
2598 | 2599 | #if defined (DEBUG_SOFTWARE_TLB) |
2599 | - if (loglevel) { | |
2600 | - fprintf(logfile, "%s: set up TLB %d RPN " ADDRX " EPN " ADDRX | |
2600 | + if (loglevel != 0) { | |
2601 | + fprintf(logfile, "%s: set up TLB %d RPN " PADDRX " EPN " ADDRX | |
2601 | 2602 | " size " ADDRX " prot %c%c%c%c PID %d\n", __func__, |
2602 | 2603 | (int)T0, tlb->RPN, tlb->EPN, tlb->size, |
2603 | 2604 | tlb->prot & PAGE_READ ? 'r' : '-', | ... | ... |