Revision c55e9aef target-ppc/op_helper.c

b/target-ppc/op_helper.c
2537 2537
    env->crf[0] = tmp;
2538 2538
}
2539 2539

  
2540
void do_4xx_tlbwe_lo (void)
2540
void do_4xx_tlbwe_hi (void)
2541 2541
{
2542 2542
    ppcemb_tlb_t *tlb;
2543 2543
    target_ulong page, end;
2544 2544

  
2545
#if defined (DEBUG_SOFTWARE_TLB)
2546
    if (loglevel) {
2547
        fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1);
2548
    }
2549
#endif
2545 2550
    T0 &= 0x3F;
2546 2551
    tlb = &env->tlb[T0].tlbe;
2547 2552
    /* Invalidate previous TLB (if it's valid) */
2548 2553
    if (tlb->prot & PAGE_VALID) {
2549 2554
        end = tlb->EPN + tlb->size;
2555
#if defined (DEBUG_SOFTWARE_TLB)
2556
        if (loglevel) {
2557
            fprintf(logfile, "%s: invalidate old TLB %d start " ADDRX
2558
                    " end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end);
2559
        }
2560
#endif
2550 2561
        for (page = tlb->EPN; page < end; page += TARGET_PAGE_SIZE)
2551 2562
            tlb_flush_page(env, page);
2552 2563
    }
2553 2564
    tlb->size = booke_tlb_to_page_size((T1 >> 7) & 0x7);
2554 2565
    tlb->EPN = (T1 & 0xFFFFFC00) & ~(tlb->size - 1);
2555
    if (T1 & 0x400)
2566
    if (T1 & 0x40)
2556 2567
        tlb->prot |= PAGE_VALID;
2557 2568
    else
2558 2569
        tlb->prot &= ~PAGE_VALID;
2559
    tlb->PID = env->spr[SPR_BOOKE_PID]; /* PID */
2570
    tlb->PID = env->spr[SPR_40x_PID]; /* PID */
2560 2571
    tlb->attr = T1 & 0xFF;
2572
#if defined (DEBUG_SOFTWARE_TLB)
2573
    if (loglevel) {
2574
        fprintf(logfile, "%s: set up TLB %d RPN " ADDRX " EPN " ADDRX
2575
                " size " ADDRX " prot %c%c%c%c PID %d\n", __func__,
2576
                (int)T0, tlb->RPN, tlb->EPN, tlb->size, 
2577
                tlb->prot & PAGE_READ ? 'r' : '-',
2578
                tlb->prot & PAGE_WRITE ? 'w' : '-',
2579
                tlb->prot & PAGE_EXEC ? 'x' : '-',
2580
                tlb->prot & PAGE_VALID ? 'v' : '-', (int)tlb->PID);
2581
    }
2582
#endif
2561 2583
    /* Invalidate new TLB (if valid) */
2562 2584
    if (tlb->prot & PAGE_VALID) {
2563 2585
        end = tlb->EPN + tlb->size;
2586
#if defined (DEBUG_SOFTWARE_TLB)
2587
        if (loglevel) {
2588
            fprintf(logfile, "%s: invalidate TLB %d start " ADDRX
2589
                    " end " ADDRX "\n", __func__, (int)T0, tlb->EPN, end);
2590
        }
2591
#endif
2564 2592
        for (page = tlb->EPN; page < end; page += TARGET_PAGE_SIZE)
2565 2593
            tlb_flush_page(env, page);
2566 2594
    }
2567 2595
}
2568 2596

  
2569
void do_4xx_tlbwe_hi (void)
2597
void do_4xx_tlbwe_lo (void)
2570 2598
{
2571 2599
    ppcemb_tlb_t *tlb;
2572 2600

  
2601
#if defined (DEBUG_SOFTWARE_TLB)
2602
    if (loglevel) {
2603
        fprintf(logfile, "%s T0 " REGX " T1 " REGX "\n", __func__, T0, T1);
2604
    }
2605
#endif
2573 2606
    T0 &= 0x3F;
2574 2607
    tlb = &env->tlb[T0].tlbe;
2575 2608
    tlb->RPN = T1 & 0xFFFFFC00;
......
2578 2611
        tlb->prot |= PAGE_EXEC;
2579 2612
    if (T1 & 0x100)
2580 2613
        tlb->prot |= PAGE_WRITE;
2614
#if defined (DEBUG_SOFTWARE_TLB)
2615
    if (loglevel) {
2616
        fprintf(logfile, "%s: set up TLB %d RPN " ADDRX " EPN " ADDRX
2617
                " size " ADDRX " prot %c%c%c%c PID %d\n", __func__,
2618
                (int)T0, tlb->RPN, tlb->EPN, tlb->size, 
2619
                tlb->prot & PAGE_READ ? 'r' : '-',
2620
                tlb->prot & PAGE_WRITE ? 'w' : '-',
2621
                tlb->prot & PAGE_EXEC ? 'x' : '-',
2622
                tlb->prot & PAGE_VALID ? 'v' : '-', (int)tlb->PID);
2623
    }
2624
#endif
2581 2625
}
2582 2626
#endif /* !CONFIG_USER_ONLY */

Also available in: Unified diff