Skip to content

Commit

Permalink
Debug traces fixes.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2721 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
j_mayer committed Apr 24, 2007
1 parent d4082e9 commit 6b80055
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions target-ppc/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void do_store_fpscr (uint32_t mask)

target_ulong ppc_load_dump_spr (int sprn)
{
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "Read SPR %d %03x => " ADDRX "\n",
sprn, sprn, env->spr[sprn]);
}
Expand All @@ -199,7 +199,7 @@ target_ulong ppc_load_dump_spr (int sprn)

void ppc_store_dump_spr (int sprn, target_ulong val)
{
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "Write SPR %d %03x => " ADDRX " <= " ADDRX "\n",
sprn, sprn, env->spr[sprn], val);
}
Expand Down Expand Up @@ -904,6 +904,7 @@ void do_fcmpo (void)
}

#if !defined (CONFIG_USER_ONLY)
void cpu_dump_rfi (target_ulong RA, target_ulong msr);
void do_rfi (void)
{
#if defined(TARGET_PPC64)
Expand All @@ -919,7 +920,7 @@ void do_rfi (void)
do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL));
#endif
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB;
}
Expand All @@ -935,7 +936,7 @@ void do_rfid (void)
do_store_msr(env, (uint32_t)(env->spr[SPR_SRR1] & ~0xFFFF0000UL));
}
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB;
}
Expand Down Expand Up @@ -1136,7 +1137,7 @@ void do_POWER_rfsvc (void)
T0 = env->ctr & 0x0000FFFFUL;
do_store_msr(env, T0);
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request |= CPU_INTERRUPT_EXITTB;
}
Expand Down Expand Up @@ -1214,7 +1215,7 @@ void do_40x_rfci (void)
env->nip = env->spr[SPR_40x_SRR2];
do_store_msr(env, env->spr[SPR_40x_SRR3] & ~0xFFFF0000);
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request = CPU_INTERRUPT_EXITTB;
}
Expand All @@ -1231,7 +1232,7 @@ void do_rfci (void)
}
do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_CSRR1] & ~0x3FFF0000);
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request = CPU_INTERRUPT_EXITTB;
}
Expand All @@ -1248,7 +1249,7 @@ void do_rfdi (void)
}
do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_DSRR1] & ~0x3FFF0000);
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request = CPU_INTERRUPT_EXITTB;
}
Expand All @@ -1265,7 +1266,7 @@ void do_rfmci (void)
}
do_store_msr(env, (uint32_t)env->spr[SPR_BOOKE_MCSRR1] & ~0x3FFF0000);
#if defined (DEBUG_OP)
dump_rfi();
cpu_dump_rfi(env->nip, do_load_msr(env));
#endif
env->interrupt_request = CPU_INTERRUPT_EXITTB;
}
Expand All @@ -1275,12 +1276,12 @@ void do_load_dcr (void)
target_ulong val;

if (unlikely(env->dcr_env == NULL)) {
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} 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);
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
Expand All @@ -1292,12 +1293,12 @@ void do_load_dcr (void)
void do_store_dcr (void)
{
if (unlikely(env->dcr_env == NULL)) {
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} 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);
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
Expand Down Expand Up @@ -2515,7 +2516,7 @@ void do_4xx_tlbwe_hi (void)
target_ulong page, end;

#if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1);
}
#endif
Expand All @@ -2525,7 +2526,7 @@ void do_4xx_tlbwe_hi (void)
if (tlb->prot & PAGE_VALID) {
end = tlb->EPN + tlb->size;
#if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "%s: invalidate old TLB %d start " ADDRX
" end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end);
}
Expand Down Expand Up @@ -2568,7 +2569,7 @@ void do_4xx_tlbwe_hi (void)
if (tlb->prot & PAGE_VALID) {
end = tlb->EPN + tlb->size;
#if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "%s: invalidate TLB %d start " ADDRX
" end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end);
}
Expand All @@ -2583,7 +2584,7 @@ void do_4xx_tlbwe_lo (void)
ppcemb_tlb_t *tlb;

#if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) {
if (loglevel != 0) {
fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1);
}
#endif
Expand All @@ -2596,8 +2597,8 @@ void do_4xx_tlbwe_lo (void)
if (T1 & 0x100)
tlb->prot |= PAGE_WRITE;
#if defined (DEBUG_SOFTWARE_TLB)
if (loglevel) {
fprintf(logfile, "%s: set up TLB %d RPN " ADDRX " EPN " ADDRX
if (loglevel != 0) {
fprintf(logfile, "%s: set up TLB %d RPN " PADDRX " EPN " ADDRX
" size " ADDRX " prot %c%c%c%c PID %d\n", __func__,
(int)T0, tlb->RPN, tlb->EPN, tlb->size,
tlb->prot & PAGE_READ ? 'r' : '-',
Expand Down

0 comments on commit 6b80055

Please sign in to comment.