Subversion Repositories HelenOS

Rev

Rev 3493 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3493 Rev 3591
Line 380... Line 380...
380
{
380
{
381
    int i;
381
    int i;
382
    tlb_data_t d;
382
    tlb_data_t d;
383
    tlb_tag_read_reg_t t;
383
    tlb_tag_read_reg_t t;
384
   
384
   
385
    printf("IT16 contents:\n");
385
    printf("TLB_ISMALL contents:\n");
386
    for (i = 0; i < 16; i++) {
386
    for (i = 0; i < tlb_ismall_size(); i++) {
387
        d.value = dtlb_data_access_read(TLB_IT16, i);
387
        d.value = dtlb_data_access_read(TLB_ISMALL, i);
388
        t.value = dtlb_tag_read_read(TLB_IT16, i);
388
        t.value = dtlb_tag_read_read(TLB_ISMALL, i);
389
        print_tlb_entry(i, t, d);
389
        print_tlb_entry(i, t, d);
390
    }
390
    }
391
   
391
   
392
    printf("IT128 contents:\n");
392
    printf("TLB_IBIG contents:\n");
393
    for (i = 0; i < 128; i++) {
393
    for (i = 0; i < tlb_ibig_size(); i++) {
394
        d.value = dtlb_data_access_read(TLB_IT128, i);
394
        d.value = dtlb_data_access_read(TLB_IBIG, i);
395
        t.value = dtlb_tag_read_read(TLB_IT128, i);
395
        t.value = dtlb_tag_read_read(TLB_IBIG, i);
396
        print_tlb_entry(i, t, d);
396
        print_tlb_entry(i, t, d);
397
    }
397
    }
398
   
398
   
399
    printf("DT16 contents:\n");
399
    printf("TLB_DSMALL contents:\n");
400
    for (i = 0; i < 16; i++) {
400
    for (i = 0; i < tlb_dsmall_size(); i++) {
401
        d.value = dtlb_data_access_read(TLB_DT16, i);
401
        d.value = dtlb_data_access_read(TLB_DSMALL, i);
402
        t.value = dtlb_tag_read_read(TLB_DT16, i);
402
        t.value = dtlb_tag_read_read(TLB_DSMALL, i);
403
        print_tlb_entry(i, t, d);
403
        print_tlb_entry(i, t, d);
404
    }
404
    }
405
   
405
   
406
    printf("DT512_1 contents:\n");
406
    printf("TLB_DBIG_1 contents:\n");
407
    for (i = 0; i < 512; i++) {
407
    for (i = 0; i < tlb_dbig_size(); i++) {
408
        d.value = dtlb_data_access_read(TLB_DT512_0, i);
408
        d.value = dtlb_data_access_read(TLB_DBIG_0, i);
409
        t.value = dtlb_tag_read_read(TLB_DT512_0, i);
409
        t.value = dtlb_tag_read_read(TLB_DBIG_0, i);
410
        print_tlb_entry(i, t, d);
410
        print_tlb_entry(i, t, d);
411
    }
411
    }
412
   
412
   
413
    printf("DT512_2 contents:\n");
413
    printf("TLB_DBIG_2 contents:\n");
414
    for (i = 0; i < 512; i++) {
414
    for (i = 0; i < tlb_dbig_size(); i++) {
415
        d.value = dtlb_data_access_read(TLB_DT512_1, i);
415
        d.value = dtlb_data_access_read(TLB_DBIG_1, i);
416
        t.value = dtlb_tag_read_read(TLB_DT512_1, i);
416
        t.value = dtlb_tag_read_read(TLB_DBIG_1, i);
417
        print_tlb_entry(i, t, d);
417
        print_tlb_entry(i, t, d);
418
    }
418
    }
419
}
419
}
420
 
420
 
421
#endif
421
#endif
Line 484... Line 484...
484
 
484
 
485
#if defined (US3)
485
#if defined (US3)
486
/** Invalidates given TLB entry if and only if it is non-locked or global.
486
/** Invalidates given TLB entry if and only if it is non-locked or global.
487
 *
487
 *
488
 * @param tlb
488
 * @param tlb
489
 *  TLB number (one of TLB_DT16, TLB_DT512_0, TLB_DT512_1,
489
 *  TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1,
490
 *  TLB_IT16, TLB_IT128)
490
 *  TLB_ISMALL, TLB_IBIG)
491
 * @param entry entry index within the given TLB
491
 * @param entry entry index within the given TLB
492
 */
492
 */
493
static void tlb_invalidate_entry(int tlb, index_t entry)
493
static void tlb_invalidate_entry(int tlb, index_t entry)
494
{
494
{
495
    tlb_data_t d;
495
    tlb_data_t d;
496
    tlb_tag_read_reg_t t;
496
    tlb_tag_read_reg_t t;
497
   
497
   
498
    if (tlb == TLB_DT16 || tlb == TLB_DT512_0 || tlb == TLB_DT512_1) {
498
    if (tlb == TLB_DSMALL || tlb == TLB_DBIG_0 || tlb == TLB_DBIG_1) {
499
        d.value = dtlb_data_access_read(tlb, entry);
499
        d.value = dtlb_data_access_read(tlb, entry);
500
        if (!d.l || d.g) {
500
        if (!d.l || d.g) {
501
            t.value = dtlb_tag_read_read(tlb, entry);
501
            t.value = dtlb_tag_read_read(tlb, entry);
502
            d.v = false;
502
            d.v = false;
503
            dtlb_tag_access_write(t.value);
503
            dtlb_tag_access_write(t.value);
504
            dtlb_data_access_write(tlb, entry, d.value);
504
            dtlb_data_access_write(tlb, entry, d.value);
505
        }
505
        }
506
    } else if (tlb == TLB_IT16 || tlb == TLB_IT128) {
506
    } else if (tlb == TLB_ISMALL || tlb == TLB_IBIG) {
507
        d.value = itlb_data_access_read(tlb, entry);
507
        d.value = itlb_data_access_read(tlb, entry);
508
        if (!d.l || d.g) {
508
        if (!d.l || d.g) {
509
            t.value = itlb_tag_read_read(tlb, entry);
509
            t.value = itlb_tag_read_read(tlb, entry);
510
            d.v = false;
510
            d.v = false;
511
            itlb_tag_access_write(t.value);
511
            itlb_tag_access_write(t.value);
Line 553... Line 553...
553
        }
553
        }
554
    }
554
    }
555
 
555
 
556
#elif defined (US3)
556
#elif defined (US3)
557
 
557
 
558
    for (i = 0; i < 16; i++)
558
    for (i = 0; i < tlb_ismall_size(); i++)
559
        tlb_invalidate_entry(TLB_IT16, i);
559
        tlb_invalidate_entry(TLB_ISMALL, i);
560
    for (i = 0; i < 128; i++)
560
    for (i = 0; i < tlb_ibig_size(); i++)
561
        tlb_invalidate_entry(TLB_IT128, i);
561
        tlb_invalidate_entry(TLB_IBIG, i);
562
    for (i = 0; i < 16; i++)
562
    for (i = 0; i < tlb_dsmall_size(); i++)
563
        tlb_invalidate_entry(TLB_DT16, i);
563
        tlb_invalidate_entry(TLB_DSMALL, i);
564
    for (i = 0; i < 512; i++)
564
    for (i = 0; i < tlb_dbig_size(); i++)
565
        tlb_invalidate_entry(TLB_DT512_0, i);
565
        tlb_invalidate_entry(TLB_DBIG_0, i);
566
    for (i = 0; i < 512; i++)
566
    for (i = 0; i < tlb_dbig_size(); i++)
567
        tlb_invalidate_entry(TLB_DT512_1, i);
567
        tlb_invalidate_entry(TLB_DBIG_1, i);
568
#endif
568
#endif
569
 
569
 
570
}
570
}
571
 
571
 
572
/** Invalidate all ITLB and DTLB entries that belong to specified ASID
572
/** Invalidate all ITLB and DTLB entries that belong to specified ASID