Subversion Repositories HelenOS-historic

Rev

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

Rev 958 Rev 983
Line 36... Line 36...
36
#include <arch.h>
36
#include <arch.h>
37
#include <symtab.h>
37
#include <symtab.h>
38
#include <synch/spinlock.h>
38
#include <synch/spinlock.h>
39
#include <print.h>
39
#include <print.h>
40
#include <debug.h>
40
#include <debug.h>
-
 
41
#include <align.h>
41
 
42
 
42
static void tlb_refill_fail(istate_t *istate);
43
static void tlb_refill_fail(istate_t *istate);
43
static void tlb_invalid_fail(istate_t *istate);
44
static void tlb_invalid_fail(istate_t *istate);
44
static void tlb_modified_fail(istate_t *istate);
45
static void tlb_modified_fail(istate_t *istate);
45
 
46
 
Line 388... Line 389...
388
    lo->pfn = pfn;
389
    lo->pfn = pfn;
389
}
390
}
390
 
391
 
391
void prepare_entry_hi(entry_hi_t *hi, asid_t asid, __address addr)
392
void prepare_entry_hi(entry_hi_t *hi, asid_t asid, __address addr)
392
{
393
{
393
    hi->value = (((addr/PAGE_SIZE)/2)*PAGE_SIZE*2);
394
    hi->value = ALIGN_DOWN(addr, PAGE_SIZE * 2);
394
    hi->asid = asid;
395
    hi->asid = asid;
395
}
396
}
396
 
397
 
397
/** Print contents of TLB. */
398
/** Print contents of TLB. */
398
void tlb_print(void)
399
void tlb_print(void)
Line 511... Line 512...
511
    ASSERT(asid != ASID_INVALID);
512
    ASSERT(asid != ASID_INVALID);
512
 
513
 
513
    hi_save.value = cp0_entry_hi_read();
514
    hi_save.value = cp0_entry_hi_read();
514
    ipl = interrupts_disable();
515
    ipl = interrupts_disable();
515
 
516
 
516
    for (i = 0; i < cnt; i++) {
517
    for (i = 0; i < cnt+1; i+=2) {
517
        hi.value = 0;
518
        hi.value = 0;
518
        prepare_entry_hi(&hi, asid, page + i * PAGE_SIZE);
519
        prepare_entry_hi(&hi, asid, page + i * PAGE_SIZE);
519
        cp0_entry_hi_write(hi.value);
520
        cp0_entry_hi_write(hi.value);
520
 
521
 
521
        tlbp();
522
        tlbp();