Revision a496775f target-ppc/helper.c

b/target-ppc/helper.c
649 649
        }
650 650
        mask = ~(tlb->size - 1);
651 651
        if (loglevel) {
652
            fprintf(logfile, "%s: TLB %d address " ADDRX " PID " ADDRX " <=> "
653
                    ADDRX " " ADDRX " " ADDRX "\n",
654
                    __func__, i, address, env->spr[SPR_40x_PID],
655
                    tlb->EPN, mask, tlb->PID);
652
            fprintf(logfile, "%s: TLB %d address " ADDRX " PID %d <=> "
653
                    ADDRX " " ADDRX " %d\n",
654
                    __func__, i, address, (int)env->spr[SPR_40x_PID],
655
                    tlb->EPN, mask, (int)tlb->PID);
656 656
        }
657 657
        /* Check PID */
658 658
        if (tlb->PID != 0 && tlb->PID != env->spr[SPR_40x_PID])
......
1450 1450
        if (loglevel) {
1451 1451
            fprintf(logfile, "DSI exception: DSISR=0x" ADDRX" DAR=0x" ADDRX
1452 1452
                    "\n", env->spr[SPR_DSISR], env->spr[SPR_DAR]);
1453
        } else {
1454
            printf("DSI exception: DSISR=0x" ADDRX" DAR=0x" ADDRX "\n",
1455
                   env->spr[SPR_DSISR], env->spr[SPR_DAR]);
1456 1453
        }
1457 1454
#endif
1458 1455
        goto store_next;
......
1495 1492
        case EXCP_FP:
1496 1493
            if (msr_fe0 == 0 && msr_fe1 == 0) {
1497 1494
#if defined (DEBUG_EXCEPTIONS)
1498
                printf("Ignore floating point exception\n");
1495
                if (loglevel) {
1496
                    fprintf(logfile, "Ignore floating point exception\n");
1497
                }
1499 1498
#endif
1500 1499
                return;
1501 1500
            }
......
1508 1507
                env->fpscr[7] |= 0x4;
1509 1508
            break;
1510 1509
        case EXCP_INVAL:
1511
            //      printf("Invalid instruction at 0x" ADDRX "\n", env->nip);
1510
#if defined (DEBUG_EXCEPTIONS)
1511
            if (loglevel) {
1512
                fprintf(logfile, "Invalid instruction at 0x" ADDRX "\n",
1513
                        env->nip);
1514
            }
1515
#endif
1512 1516
            msr |= 0x00080000;
1513 1517
            break;
1514 1518
        case EXCP_PRIV:
......
1609 1613
        case PPC_FLAGS_EXCP_40x:
1610 1614
            /* PIT on 4xx */
1611 1615
            msr &= ~0xFFFF0000;
1616
#if defined (DEBUG_EXCEPTIONS)
1612 1617
            if (loglevel != 0)
1613 1618
                fprintf(logfile, "PIT exception\n");
1619
#endif
1614 1620
            goto store_next;
1615 1621
        case PPC_FLAGS_EXCP_602:
1616 1622
        case PPC_FLAGS_EXCP_603:
......
1630 1636
        case PPC_FLAGS_EXCP_40x:
1631 1637
            /* FIT on 4xx */
1632 1638
            msr &= ~0xFFFF0000;
1639
#if defined (DEBUG_EXCEPTIONS)
1633 1640
            if (loglevel != 0)
1634 1641
                fprintf(logfile, "FIT exception\n");
1642
#endif
1635 1643
            goto store_next;
1636 1644
        default:
1637 1645
            cpu_abort(env, "Invalid exception 0x1010 !\n");
......
1644 1652
        case PPC_FLAGS_EXCP_40x:
1645 1653
            /* Watchdog on 4xx */
1646 1654
            msr &= ~0xFFFF0000;
1655
#if defined (DEBUG_EXCEPTIONS)
1647 1656
            if (loglevel != 0)
1648 1657
                fprintf(logfile, "WDT exception\n");
1658
#endif
1649 1659
            goto store_next;
1650 1660
        case PPC_FLAGS_EXCP_BOOKE:
1651 1661
            srr_0 = &env->spr[SPR_BOOKE_CSRR0];
......
1929 1939
{
1930 1940
    int raised = 0;
1931 1941

  
1932
#if 0
1933
    printf("%s: %p pending %08x req %08x %08x me %d ee %d\n",
1934
           __func__, env, env->pending_interrupts,
1935
           env->interrupt_request, interrupt_request,
1936
           msr_me, msr_ee);
1942
#if 1
1943
    if (loglevel & CPU_LOG_INT) {
1944
        fprintf(logfile, "%s: %p pending %08x req %08x me %d ee %d\n",
1945
                __func__, env, env->pending_interrupts,
1946
                env->interrupt_request, msr_me, msr_ee);
1947
    }
1937 1948
#endif
1938 1949
    /* Raise it */
1939 1950
    if (env->pending_interrupts & (1 << PPC_INTERRUPT_RESET)) {
......
2007 2018
    }
2008 2019
}
2009 2020
#endif /* !CONFIG_USER_ONLY */
2021

  
2022
void cpu_dump_EA (target_ulong EA)
2023
{
2024
    FILE *f;
2025

  
2026
    if (logfile) {
2027
        f = logfile;
2028
    } else {
2029
        f = stdout;
2030
        return;
2031
    }
2032
    fprintf(f, "Memory access at address " TARGET_FMT_lx "\n", EA);
2033
}
2034

  

Also available in: Unified diff