Debug traces fixes.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2721 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
j_mayer 2007-04-24 07:36:03 +00:00
parent d4082e95f1
commit 6b80055dfa

View File

@ -189,7 +189,7 @@ void do_store_fpscr (uint32_t mask)
target_ulong ppc_load_dump_spr (int sprn) target_ulong ppc_load_dump_spr (int sprn)
{ {
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "Read SPR %d %03x => " ADDRX "\n", fprintf(logfile, "Read SPR %d %03x => " ADDRX "\n",
sprn, sprn, env->spr[sprn]); sprn, sprn, env->spr[sprn]);
} }
@ -199,7 +199,7 @@ target_ulong ppc_load_dump_spr (int sprn)
void ppc_store_dump_spr (int sprn, target_ulong val) void ppc_store_dump_spr (int sprn, target_ulong val)
{ {
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "Write SPR %d %03x => " ADDRX " <= " ADDRX "\n", fprintf(logfile, "Write SPR %d %03x => " ADDRX " <= " ADDRX "\n",
sprn, sprn, env->spr[sprn], val); sprn, sprn, env->spr[sprn], val);
} }
@ -904,6 +904,7 @@ void do_fcmpo (void)
} }
#if !defined (CONFIG_USER_ONLY) #if !defined (CONFIG_USER_ONLY)
void cpu_dump_rfi (target_ulong RA, target_ulong msr);
void do_rfi (void) void do_rfi (void)
{ {
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
@ -919,7 +920,7 @@ void do_rfi (void)
do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL)); do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL));
#endif #endif
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB; env->interrupt_request |= CPU_INTERRUPT_EXITTB;
} }
@ -935,7 +936,7 @@ void do_rfid (void)
do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL)); do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL));
} }
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB; env->interrupt_request |= CPU_INTERRUPT_EXITTB;
} }
@ -1136,7 +1137,7 @@ void do_POWER_rfsvc (void)
T0 = env->ctr & 0x0000FFFFUL; T0 = env->ctr & 0x0000FFFFUL;
do_store_msr(env, T0); do_store_msr(env, T0);
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB; env->interrupt_request |= CPU_INTERRUPT_EXITTB;
} }
@ -1214,7 +1215,7 @@ void do_40x_rfci (void)
env->nip = env->spr[SPR_40x_SRR2]; env->nip = env->spr[SPR_40x_SRR2];
do_store_msr(env, env->spr[SPR_40x_SRR3] & ~0xFFFF0000); do_store_msr(env, env->spr[SPR_40x_SRR3] & ~0xFFFF0000);
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request = CPU_INTERRUPT_EXITTB; env->interrupt_request = CPU_INTERRUPT_EXITTB;
} }
@ -1231,7 +1232,7 @@ void do_rfci (void)
} }
do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_CSRR1] & ~0x3FFF0000); do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_CSRR1] & ~0x3FFF0000);
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request = CPU_INTERRUPT_EXITTB; env->interrupt_request = CPU_INTERRUPT_EXITTB;
} }
@ -1248,7 +1249,7 @@ void do_rfdi (void)
} }
do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_DSRR1] & ~0x3FFF0000); do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_DSRR1] & ~0x3FFF0000);
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request = CPU_INTERRUPT_EXITTB; env->interrupt_request = CPU_INTERRUPT_EXITTB;
} }
@ -1265,7 +1266,7 @@ void do_rfmci (void)
} }
do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_MCSRR1] & ~0x3FFF0000); do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_MCSRR1] & ~0x3FFF0000);
#if defined (DEBUG_OP) #if defined (DEBUG_OP)
dump_rfi(); cpu_dump_rfi(env->nip, do_load_msr(env));
#endif #endif
env->interrupt_request = CPU_INTERRUPT_EXITTB; env->interrupt_request = CPU_INTERRUPT_EXITTB;
} }
@ -1275,12 +1276,12 @@ void do_load_dcr (void)
target_ulong val; target_ulong val;
if (unlikely(env->dcr_env == NULL)) { if (unlikely(env->dcr_env == NULL)) {
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n"); fprintf(logfile, "No DCR environment\n");
} }
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) { } else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) {
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0); fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0);
} }
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
@ -1292,12 +1293,12 @@ void do_load_dcr (void)
void do_store_dcr (void) void do_store_dcr (void)
{ {
if (unlikely(env->dcr_env == NULL)) { if (unlikely(env->dcr_env == NULL)) {
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n"); fprintf(logfile, "No DCR environment\n");
} }
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) { } else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) {
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0); fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0);
} }
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
@ -2515,7 +2516,7 @@ void do_4xx_tlbwe_hi (void)
target_ulong page, end; target_ulong page, end;
#if defined (DEBUG_SOFTWARE_TLB) #if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1); fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1);
} }
#endif #endif
@ -2525,7 +2526,7 @@ void do_4xx_tlbwe_hi (void)
if (tlb->prot & PAGE_VALID) { if (tlb->prot & PAGE_VALID) {
end = tlb->EPN + tlb->size; end = tlb->EPN + tlb->size;
#if defined (DEBUG_SOFTWARE_TLB) #if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "%s: invalidate old TLB %d start " ADDRX fprintf(logfile, "%s: invalidate old TLB %d start " ADDRX
" end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end); " end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end);
} }
@ -2568,7 +2569,7 @@ void do_4xx_tlbwe_hi (void)
if (tlb->prot & PAGE_VALID) { if (tlb->prot & PAGE_VALID) {
end = tlb->EPN + tlb->size; end = tlb->EPN + tlb->size;
#if defined (DEBUG_SOFTWARE_TLB) #if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "%s: invalidate TLB %d start " ADDRX fprintf(logfile, "%s: invalidate TLB %d start " ADDRX
" end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end); " end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end);
} }
@ -2583,7 +2584,7 @@ void do_4xx_tlbwe_lo (void)
ppcemb_tlb_t *tlb; ppcemb_tlb_t *tlb;
#if defined (DEBUG_SOFTWARE_TLB) #if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1); fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1);
} }
#endif #endif
@ -2596,8 +2597,8 @@ void do_4xx_tlbwe_lo (void)
if (T1 & 0x100) if (T1 & 0x100)
tlb->prot |= PAGE_WRITE; tlb->prot |= PAGE_WRITE;
#if defined (DEBUG_SOFTWARE_TLB) #if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) { if (loglevel != 0) {
fprintf(logfile, "%s: set up TLB %d RPN " ADDRX " EPN " ADDRX fprintf(logfile, "%s: set up TLB %d RPN " PADDRX " EPN " ADDRX
" size " ADDRX " prot %c%c%c%c PID %d\n", __func__, " size " ADDRX " prot %c%c%c%c PID %d\n", __func__,
(int)T0, tlb->RPN, tlb->EPN, tlb->size, (int)T0, tlb->RPN, tlb->EPN, tlb->size,
tlb->prot & PAGE_READ ? 'r' : '-', tlb->prot & PAGE_READ ? 'r' : '-',