Subversion Repositories HelenOS-historic

Rev

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

Rev 1411 Rev 1621
Line 43... Line 43...
43
#include <arch/asm.h>
43
#include <arch/asm.h>
44
#include <typedefs.h>
44
#include <typedefs.h>
45
#include <panic.h>
45
#include <panic.h>
46
#include <print.h>
46
#include <print.h>
47
#include <arch.h>
47
#include <arch.h>
-
 
48
#include <interrupt.h>
48
 
49
 
49
/** Invalidate all TLB entries. */
50
/** Invalidate all TLB entries. */
50
void tlb_invalidate_all(void)
51
void tlb_invalidate_all(void)
51
{
52
{
52
        ipl_t ipl;
53
        ipl_t ipl;
Line 450... Line 451...
450
        /*
451
        /*
451
         * Forward the page fault to address space page fault handler.
452
         * Forward the page fault to address space page fault handler.
452
         */
453
         */
453
        page_table_unlock(AS, true);
454
        page_table_unlock(AS, true);
454
        if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
455
        if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
-
 
456
            fault_if_from_uspace(istate,"Page fault at %P",va);
455
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
457
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
456
        }
458
        }
457
    }
459
    }
458
}
460
}
459
 
461
 
Line 496... Line 498...
496
        /*
498
        /*
497
         * Forward the page fault to address space page fault handler.
499
         * Forward the page fault to address space page fault handler.
498
         */
500
         */
499
        page_table_unlock(AS, true);
501
        page_table_unlock(AS, true);
500
        if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
502
        if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
-
 
503
            fault_if_from_uspace(istate,"Page fault at %P",va);
501
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
504
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
502
        }
505
        }
503
    }
506
    }
504
}
507
}
505
 
508
 
Line 541... Line 544...
541
         */
544
         */
542
        t->d = true;
545
        t->d = true;
543
        dtc_pte_copy(t);
546
        dtc_pte_copy(t);
544
    } else {
547
    } else {
545
        if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) {
548
        if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) {
-
 
549
            fault_if_from_uspace(istate,"Page fault at %P",va);
546
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
550
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
547
            t->d = true;
551
            t->d = true;
548
            dtc_pte_copy(t);
552
            dtc_pte_copy(t);
549
        }
553
        }
550
    }
554
    }
Line 577... Line 581...
577
         */
581
         */
578
        t->a = true;
582
        t->a = true;
579
        itc_pte_copy(t);
583
        itc_pte_copy(t);
580
    } else {
584
    } else {
581
        if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
585
        if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
-
 
586
            fault_if_from_uspace(istate,"Page fault at %P",va);
582
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
587
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
583
            t->a = true;
588
            t->a = true;
584
            itc_pte_copy(t);
589
            itc_pte_copy(t);
585
        }
590
        }
586
    }
591
    }
Line 613... Line 618...
613
         */
618
         */
614
        t->a = true;
619
        t->a = true;
615
        dtc_pte_copy(t);
620
        dtc_pte_copy(t);
616
    } else {
621
    } else {
617
        if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
622
        if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
-
 
623
            fault_if_from_uspace(istate,"Page fault at %P",va);
618
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
624
            panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip);
619
            t->a = true;
625
            t->a = true;
620
            itc_pte_copy(t);
626
            itc_pte_copy(t);
621
        }
627
        }
622
    }
628
    }
Line 654... Line 660...
654
            dtc_pte_copy(t);
660
            dtc_pte_copy(t);
655
        page_table_unlock(AS, true);
661
        page_table_unlock(AS, true);
656
    } else {
662
    } else {
657
        page_table_unlock(AS, true);
663
        page_table_unlock(AS, true);
658
        if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
664
        if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
-
 
665
            fault_if_from_uspace(istate,"Page fault at %P",va);
659
            panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, rid);
666
            panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, rid);
660
        }
667
        }
661
    }
668
    }
662
}
669
}