Changes in kernel/arch/ia64/src/mm/tlb.c [560b81c:1dbc43f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/mm/tlb.c
r560b81c r1dbc43f 477 477 /** Instruction TLB fault handler for faults with VHPT turned off. 478 478 * 479 * @param nInterruption vector.480 * @param istate Structure with saved interruption state. 481 * 482 */ 483 void alternate_instruction_tlb_fault(u nsigned int n, istate_t *istate)479 * @param vector Interruption vector. 480 * @param istate Structure with saved interruption state. 481 * 482 */ 483 void alternate_instruction_tlb_fault(uint64_t vector, istate_t *istate) 484 484 { 485 485 uintptr_t va; 486 pte_t t;486 pte_t *t; 487 487 488 488 va = istate->cr_ifa; /* faulting address */ … … 490 490 ASSERT(!is_kernel_fault(va)); 491 491 492 bool found = page_mapping_find(AS, va, true, &t); 493 if (found) { 494 ASSERT(t.p); 495 492 t = page_mapping_find(AS, va, true); 493 if (t) { 496 494 /* 497 495 * The mapping was found in software page hash table. 498 496 * Insert it into data translation cache. 499 497 */ 500 itc_pte_copy( &t);498 itc_pte_copy(t); 501 499 } else { 502 500 /* … … 568 566 /** Data TLB fault handler for faults with VHPT turned off. 569 567 * 570 * @param nInterruption vector.571 * @param istate Structure with saved interruption state. 572 * 573 */ 574 void alternate_data_tlb_fault(u nsigned int n, istate_t *istate)568 * @param vector Interruption vector. 569 * @param istate Structure with saved interruption state. 570 * 571 */ 572 void alternate_data_tlb_fault(uint64_t vector, istate_t *istate) 575 573 { 576 574 if (istate->cr_isr.sp) { … … 602 600 603 601 604 pte_t t; 605 bool found = page_mapping_find(as, va, true, &t); 606 if (found) { 607 ASSERT(t.p); 608 602 pte_t *entry = page_mapping_find(as, va, true); 603 if (entry) { 609 604 /* 610 605 * The mapping was found in the software page hash table. 611 606 * Insert it into data translation cache. 612 607 */ 613 dtc_pte_copy( &t);608 dtc_pte_copy(entry); 614 609 } else { 615 610 if (try_memmap_io_insertion(va, istate)) … … 628 623 * This fault should not occur. 629 624 * 630 * @param nInterruption vector.631 * @param istate Structure with saved interruption state. 632 * 633 */ 634 void data_nested_tlb_fault(u nsigned int n, istate_t *istate)625 * @param vector Interruption vector. 626 * @param istate Structure with saved interruption state. 627 * 628 */ 629 void data_nested_tlb_fault(uint64_t vector, istate_t *istate) 635 630 { 636 631 ASSERT(false); … … 639 634 /** Data Dirty bit fault handler. 640 635 * 641 * @param nInterruption vector.642 * @param istate Structure with saved interruption state. 643 * 644 */ 645 void data_dirty_bit_fault(u nsigned int n, istate_t *istate)636 * @param vector Interruption vector. 637 * @param istate Structure with saved interruption state. 638 * 639 */ 640 void data_dirty_bit_fault(uint64_t vector, istate_t *istate) 646 641 { 647 642 uintptr_t va; 648 pte_t t;643 pte_t *t; 649 644 as_t *as = AS; 650 645 … … 654 649 as = AS_KERNEL; 655 650 656 bool found = page_mapping_find(as, va, true, &t); 657 658 ASSERT(found); 659 ASSERT(t.p); 660 661 if (found && t.p && t.w) { 651 t = page_mapping_find(as, va, true); 652 ASSERT((t) && (t->p)); 653 if ((t) && (t->p) && (t->w)) { 662 654 /* 663 655 * Update the Dirty bit in page tables and reinsert 664 656 * the mapping into DTC. 665 657 */ 666 t.d = true; 667 dtc_pte_copy(&t); 668 page_mapping_update(as, va, true, &t); 658 t->d = true; 659 dtc_pte_copy(t); 669 660 } else { 670 661 as_page_fault(va, PF_ACCESS_WRITE, istate); … … 674 665 /** Instruction access bit fault handler. 675 666 * 676 * @param nInterruption vector.677 * @param istate Structure with saved interruption state. 678 * 679 */ 680 void instruction_access_bit_fault(u nsigned int n, istate_t *istate)667 * @param vector Interruption vector. 668 * @param istate Structure with saved interruption state. 669 * 670 */ 671 void instruction_access_bit_fault(uint64_t vector, istate_t *istate) 681 672 { 682 673 uintptr_t va; 683 pte_t t;674 pte_t *t; 684 675 685 676 va = istate->cr_ifa; /* faulting address */ … … 687 678 ASSERT(!is_kernel_fault(va)); 688 679 689 bool found = page_mapping_find(AS, va, true, &t); 690 691 ASSERT(found); 692 ASSERT(t.p); 693 694 if (found && t.p && t.x) { 680 t = page_mapping_find(AS, va, true); 681 ASSERT((t) && (t->p)); 682 if ((t) && (t->p) && (t->x)) { 695 683 /* 696 684 * Update the Accessed bit in page tables and reinsert 697 685 * the mapping into ITC. 698 686 */ 699 t.a = true; 700 itc_pte_copy(&t); 701 page_mapping_update(AS, va, true, &t); 687 t->a = true; 688 itc_pte_copy(t); 702 689 } else { 703 690 as_page_fault(va, PF_ACCESS_EXEC, istate); … … 707 694 /** Data access bit fault handler. 708 695 * 709 * @param nInterruption vector.710 * @param istate Structure with saved interruption state. 711 * 712 */ 713 void data_access_bit_fault(u nsigned int n, istate_t *istate)696 * @param vector Interruption vector. 697 * @param istate Structure with saved interruption state. 698 * 699 */ 700 void data_access_bit_fault(uint64_t vector, istate_t *istate) 714 701 { 715 702 uintptr_t va; 716 pte_t t;703 pte_t *t; 717 704 as_t *as = AS; 718 705 … … 722 709 as = AS_KERNEL; 723 710 724 bool found = page_mapping_find(as, va, true, &t); 725 726 ASSERT(found); 727 ASSERT(t.p); 728 729 if (found && t.p) { 711 t = page_mapping_find(as, va, true); 712 ASSERT((t) && (t->p)); 713 if ((t) && (t->p)) { 730 714 /* 731 715 * Update the Accessed bit in page tables and reinsert 732 716 * the mapping into DTC. 733 717 */ 734 t.a = true; 735 dtc_pte_copy(&t); 736 page_mapping_update(as, va, true, &t); 718 t->a = true; 719 dtc_pte_copy(t); 737 720 } else { 738 721 if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) { … … 746 729 /** Data access rights fault handler. 747 730 * 748 * @param nInterruption vector.749 * @param istate Structure with saved interruption state. 750 * 751 */ 752 void data_access_rights_fault(u nsigned int n, istate_t *istate)731 * @param vector Interruption vector. 732 * @param istate Structure with saved interruption state. 733 * 734 */ 735 void data_access_rights_fault(uint64_t vector, istate_t *istate) 753 736 { 754 737 uintptr_t va; 755 pte_t t;738 pte_t *t; 756 739 757 740 va = istate->cr_ifa; /* faulting address */ … … 762 745 * Assume a write to a read-only page. 763 746 */ 764 bool found = page_mapping_find(AS, va, true, &t); 765 766 ASSERT(found); 767 ASSERT(t.p); 768 ASSERT(!t.w); 769 747 t = page_mapping_find(AS, va, true); 748 ASSERT((t) && (t->p)); 749 ASSERT(!t->w); 770 750 as_page_fault(va, PF_ACCESS_WRITE, istate); 771 751 } … … 773 753 /** Page not present fault handler. 774 754 * 775 * @param nInterruption vector.776 * @param istate Structure with saved interruption state. 777 * 778 */ 779 void page_not_present(u nsigned int n, istate_t *istate)755 * @param vector Interruption vector. 756 * @param istate Structure with saved interruption state. 757 * 758 */ 759 void page_not_present(uint64_t vector, istate_t *istate) 780 760 { 781 761 uintptr_t va; 782 pte_t t;762 pte_t *t; 783 763 784 764 va = istate->cr_ifa; /* faulting address */ … … 786 766 ASSERT(!is_kernel_fault(va)); 787 767 788 bool found = page_mapping_find(AS, va, true, &t); 789 790 ASSERT(found); 791 792 if (t.p) { 768 t = page_mapping_find(AS, va, true); 769 ASSERT(t); 770 771 if (t->p) { 793 772 /* 794 773 * If the Present bit is set in page hash table, just copy it 795 774 * and update ITC/DTC. 796 775 */ 797 if (t .x)798 itc_pte_copy( &t);776 if (t->x) 777 itc_pte_copy(t); 799 778 else 800 dtc_pte_copy( &t);779 dtc_pte_copy(t); 801 780 } else { 802 781 as_page_fault(va, PF_ACCESS_READ, istate);
Note:
See TracChangeset
for help on using the changeset viewer.