Subversion Repositories HelenOS

Rev

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

Rev 4296 Rev 4420
Line 495... Line 495...
495
    printf("DTLB SFAR: address=%p\n", sfar);
495
    printf("DTLB SFAR: address=%p\n", sfar);
496
   
496
   
497
    dtlb_sfsr_write(0);
497
    dtlb_sfsr_write(0);
498
}
498
}
499
 
499
 
500
#if defined (US3)
500
#if defined (US)
501
/** Invalidates given TLB entry if and only if it is non-locked or global.
-
 
502
 *
-
 
503
 * @param tlb       TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1,
-
 
504
 *          TLB_ISMALL, TLB_IBIG).
-
 
505
 * @param entry     Entry index within the given TLB.
-
 
506
 */
-
 
507
static void tlb_invalidate_entry(int tlb, index_t entry)
-
 
508
{
-
 
509
    tlb_data_t d;
-
 
510
    tlb_tag_read_reg_t t;
-
 
511
   
-
 
512
    if (tlb == TLB_DSMALL || tlb == TLB_DBIG_0 || tlb == TLB_DBIG_1) {
-
 
513
        d.value = dtlb_data_access_read(tlb, entry);
-
 
514
        if (!d.l || d.g) {
-
 
515
            t.value = dtlb_tag_read_read(tlb, entry);
-
 
516
            d.v = false;
-
 
517
            dtlb_tag_access_write(t.value);
-
 
518
            dtlb_data_access_write(tlb, entry, d.value);
-
 
519
        }
-
 
520
    } else if (tlb == TLB_ISMALL || tlb == TLB_IBIG) {
-
 
521
        d.value = itlb_data_access_read(tlb, entry);
-
 
522
        if (!d.l || d.g) {
-
 
523
            t.value = itlb_tag_read_read(tlb, entry);
-
 
524
            d.v = false;
-
 
525
            itlb_tag_access_write(t.value);
-
 
526
            itlb_data_access_write(tlb, entry, d.value);
-
 
527
        }
-
 
528
    }
-
 
529
}
-
 
530
#endif
-
 
531
 
-
 
532
/** Invalidate all unlocked ITLB and DTLB entries. */
501
/** Invalidate all unlocked ITLB and DTLB entries. */
533
void tlb_invalidate_all(void)
502
void tlb_invalidate_all(void)
534
{
503
{
535
    int i;
504
    int i;
536
   
505
   
Line 541... Line 510...
541
     * found must have been created by someone else. Their only purpose now
510
     * found must have been created by someone else. Their only purpose now
542
     * is to collide with proper mappings. Invalidate immediately. It should
511
     * is to collide with proper mappings. Invalidate immediately. It should
543
     * be safe to invalidate them as late as now.
512
     * be safe to invalidate them as late as now.
544
     */
513
     */
545
 
514
 
546
#if defined (US)
-
 
547
    tlb_data_t d;
515
    tlb_data_t d;
548
    tlb_tag_read_reg_t t;
516
    tlb_tag_read_reg_t t;
549
 
517
 
550
    for (i = 0; i < ITLB_ENTRY_COUNT; i++) {
518
    for (i = 0; i < ITLB_ENTRY_COUNT; i++) {
551
        d.value = itlb_data_access_read(i);
519
        d.value = itlb_data_access_read(i);
Line 565... Line 533...
565
            dtlb_tag_access_write(t.value);
533
            dtlb_tag_access_write(t.value);
566
            dtlb_data_access_write(i, d.value);
534
            dtlb_data_access_write(i, d.value);
567
        }
535
        }
568
    }
536
    }
569
 
537
 
570
#elif defined (US3)
538
}
571
 
539
 
572
    for (i = 0; i < tlb_ismall_size(); i++)
-
 
573
        tlb_invalidate_entry(TLB_ISMALL, i);
-
 
574
    for (i = 0; i < tlb_ibig_size(); i++)
-
 
575
        tlb_invalidate_entry(TLB_IBIG, i);
540
#elif defined (US3)
576
    for (i = 0; i < tlb_dsmall_size(); i++)
-
 
577
        tlb_invalidate_entry(TLB_DSMALL, i);
-
 
578
    for (i = 0; i < tlb_dbig_size(); i++)
-
 
579
        tlb_invalidate_entry(TLB_DBIG_0, i);
-
 
580
    for (i = 0; i < tlb_dbig_size(); i++)
-
 
581
        tlb_invalidate_entry(TLB_DBIG_1, i);
-
 
582
#endif
-
 
583
 
541
 
-
 
542
/** Invalidate all unlocked ITLB and DTLB entries. */
-
 
543
void tlb_invalidate_all(void)
-
 
544
{
-
 
545
    itlb_demap(TLB_DEMAP_ALL, 0, 0);
-
 
546
    dtlb_demap(TLB_DEMAP_ALL, 0, 0);
584
}
547
}
585
 
548
 
-
 
549
#endif
-
 
550
 
586
/** Invalidate all ITLB and DTLB entries that belong to specified ASID
551
/** Invalidate all ITLB and DTLB entries that belong to specified ASID
587
 * (Context).
552
 * (Context).
588
 *
553
 *
589
 * @param asid Address Space ID.
554
 * @param asid Address Space ID.
590
 */
555
 */