Rev 4581 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4581 | Rev 4718 | ||
---|---|---|---|
Line 708... | Line 708... | ||
708 | } |
708 | } |
709 | } |
709 | } |
710 | page_table_unlock(AS, true); |
710 | page_table_unlock(AS, true); |
711 | } |
711 | } |
712 | 712 | ||
- | 713 | /** Data access rights fault handler. |
|
- | 714 | * |
|
- | 715 | * @param vector Interruption vector. |
|
- | 716 | * @param istate Structure with saved interruption state. |
|
- | 717 | */ |
|
- | 718 | void data_access_rights_fault(uint64_t vector, istate_t *istate) |
|
- | 719 | { |
|
- | 720 | region_register rr; |
|
- | 721 | rid_t rid; |
|
- | 722 | uintptr_t va; |
|
- | 723 | pte_t *t; |
|
- | 724 | ||
- | 725 | va = istate->cr_ifa; /* faulting address */ |
|
- | 726 | rr.word = rr_read(VA2VRN(va)); |
|
- | 727 | rid = rr.map.rid; |
|
- | 728 | ||
- | 729 | /* |
|
- | 730 | * Assume a write to a read-only page. |
|
- | 731 | */ |
|
- | 732 | page_table_lock(AS, true); |
|
- | 733 | t = page_mapping_find(AS, va); |
|
- | 734 | ASSERT(t && t->p); |
|
- | 735 | ASSERT(!t->w); |
|
- | 736 | if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) { |
|
- | 737 | fault_if_from_uspace(istate, "Page fault at %p.", va); |
|
- | 738 | panic("%s: va=%p, rid=%d, iip=%p.", __func__, va, rid, |
|
- | 739 | istate->cr_iip); |
|
- | 740 | } |
|
- | 741 | page_table_unlock(AS, true); |
|
- | 742 | } |
|
- | 743 | ||
713 | /** Page not present fault handler. |
744 | /** Page not present fault handler. |
714 | * |
745 | * |
715 | * @param vector Interruption vector. |
746 | * @param vector Interruption vector. |
716 | * @param istate Structure with saved interruption state. |
747 | * @param istate Structure with saved interruption state. |
717 | */ |
748 | */ |