Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/mm/tlb.c

    r560b81c r1dbc43f  
    477477/** Instruction TLB fault handler for faults with VHPT turned off.
    478478 *
    479  * @param n Interruption vector.
    480  * @param istate Structure with saved interruption state.
    481  *
    482  */
    483 void alternate_instruction_tlb_fault(unsigned int n, istate_t *istate)
     479 * @param vector Interruption vector.
     480 * @param istate Structure with saved interruption state.
     481 *
     482 */
     483void alternate_instruction_tlb_fault(uint64_t vector, istate_t *istate)
    484484{
    485485        uintptr_t va;
    486         pte_t t;
     486        pte_t *t;
    487487       
    488488        va = istate->cr_ifa; /* faulting address */
     
    490490        ASSERT(!is_kernel_fault(va));
    491491
    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) {
    496494                /*
    497495                 * The mapping was found in software page hash table.
    498496                 * Insert it into data translation cache.
    499497                 */
    500                 itc_pte_copy(&t);
     498                itc_pte_copy(t);
    501499        } else {
    502500                /*
     
    568566/** Data TLB fault handler for faults with VHPT turned off.
    569567 *
    570  * @param n Interruption vector.
    571  * @param istate Structure with saved interruption state.
    572  *
    573  */
    574 void alternate_data_tlb_fault(unsigned int n, istate_t *istate)
     568 * @param vector Interruption vector.
     569 * @param istate Structure with saved interruption state.
     570 *
     571 */
     572void alternate_data_tlb_fault(uint64_t vector, istate_t *istate)
    575573{
    576574        if (istate->cr_isr.sp) {
     
    602600       
    603601       
    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) {
    609604                /*
    610605                 * The mapping was found in the software page hash table.
    611606                 * Insert it into data translation cache.
    612607                 */
    613                 dtc_pte_copy(&t);
     608                dtc_pte_copy(entry);
    614609        } else {
    615610                if (try_memmap_io_insertion(va, istate))
     
    628623 * This fault should not occur.
    629624 *
    630  * @param n Interruption vector.
    631  * @param istate Structure with saved interruption state.
    632  *
    633  */
    634 void data_nested_tlb_fault(unsigned int n, istate_t *istate)
     625 * @param vector Interruption vector.
     626 * @param istate Structure with saved interruption state.
     627 *
     628 */
     629void data_nested_tlb_fault(uint64_t vector, istate_t *istate)
    635630{
    636631        ASSERT(false);
     
    639634/** Data Dirty bit fault handler.
    640635 *
    641  * @param n Interruption vector.
    642  * @param istate Structure with saved interruption state.
    643  *
    644  */
    645 void data_dirty_bit_fault(unsigned int n, istate_t *istate)
     636 * @param vector Interruption vector.
     637 * @param istate Structure with saved interruption state.
     638 *
     639 */
     640void data_dirty_bit_fault(uint64_t vector, istate_t *istate)
    646641{
    647642        uintptr_t va;
    648         pte_t t;
     643        pte_t *t;
    649644        as_t *as = AS;
    650645       
     
    654649                as = AS_KERNEL;
    655650
    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)) {
    662654                /*
    663655                 * Update the Dirty bit in page tables and reinsert
    664656                 * the mapping into DTC.
    665657                 */
    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);
    669660        } else {
    670661                as_page_fault(va, PF_ACCESS_WRITE, istate);
     
    674665/** Instruction access bit fault handler.
    675666 *
    676  * @param n Interruption vector.
    677  * @param istate Structure with saved interruption state.
    678  *
    679  */
    680 void instruction_access_bit_fault(unsigned int n, istate_t *istate)
     667 * @param vector Interruption vector.
     668 * @param istate Structure with saved interruption state.
     669 *
     670 */
     671void instruction_access_bit_fault(uint64_t vector, istate_t *istate)
    681672{
    682673        uintptr_t va;
    683         pte_t t;
     674        pte_t *t;
    684675       
    685676        va = istate->cr_ifa;  /* faulting address */
     
    687678        ASSERT(!is_kernel_fault(va));
    688679       
    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)) {
    695683                /*
    696684                 * Update the Accessed bit in page tables and reinsert
    697685                 * the mapping into ITC.
    698686                 */
    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);
    702689        } else {
    703690                as_page_fault(va, PF_ACCESS_EXEC, istate);
     
    707694/** Data access bit fault handler.
    708695 *
    709  * @param n Interruption vector.
    710  * @param istate Structure with saved interruption state.
    711  *
    712  */
    713 void data_access_bit_fault(unsigned int n, istate_t *istate)
     696 * @param vector Interruption vector.
     697 * @param istate Structure with saved interruption state.
     698 *
     699 */
     700void data_access_bit_fault(uint64_t vector, istate_t *istate)
    714701{
    715702        uintptr_t va;
    716         pte_t t;
     703        pte_t *t;
    717704        as_t *as = AS;
    718705       
     
    722709                as = AS_KERNEL;
    723710
    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)) {
    730714                /*
    731715                 * Update the Accessed bit in page tables and reinsert
    732716                 * the mapping into DTC.
    733717                 */
    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);
    737720        } else {
    738721                if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
     
    746729/** Data access rights fault handler.
    747730 *
    748  * @param n Interruption vector.
    749  * @param istate Structure with saved interruption state.
    750  *
    751  */
    752 void data_access_rights_fault(unsigned int n, istate_t *istate)
     731 * @param vector Interruption vector.
     732 * @param istate Structure with saved interruption state.
     733 *
     734 */
     735void data_access_rights_fault(uint64_t vector, istate_t *istate)
    753736{
    754737        uintptr_t va;
    755         pte_t t;
     738        pte_t *t;
    756739       
    757740        va = istate->cr_ifa;  /* faulting address */
     
    762745         * Assume a write to a read-only page.
    763746         */
    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);
    770750        as_page_fault(va, PF_ACCESS_WRITE, istate);
    771751}
     
    773753/** Page not present fault handler.
    774754 *
    775  * @param n Interruption vector.
    776  * @param istate Structure with saved interruption state.
    777  *
    778  */
    779 void page_not_present(unsigned int n, istate_t *istate)
     755 * @param vector Interruption vector.
     756 * @param istate Structure with saved interruption state.
     757 *
     758 */
     759void page_not_present(uint64_t vector, istate_t *istate)
    780760{
    781761        uintptr_t va;
    782         pte_t t;
     762        pte_t *t;
    783763       
    784764        va = istate->cr_ifa;  /* faulting address */
     
    786766        ASSERT(!is_kernel_fault(va));
    787767
    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) {
    793772                /*
    794773                 * If the Present bit is set in page hash table, just copy it
    795774                 * and update ITC/DTC.
    796775                 */
    797                 if (t.x)
    798                         itc_pte_copy(&t);
     776                if (t->x)
     777                        itc_pte_copy(t);
    799778                else
    800                         dtc_pte_copy(&t);
     779                        dtc_pte_copy(t);
    801780        } else {
    802781                as_page_fault(va, PF_ACCESS_READ, istate);
Note: See TracChangeset for help on using the changeset viewer.