Changeset f9425006 in mainline


Ignore:
Timestamp:
2006-01-13T16:29:20Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
214e89e3
Parents:
20d50a1
Message:

Make various mips32 tlb manipulation functions preserve EntryHi register.

Cleanup and more precise comments for previous commit.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/mm/tlb.c

    r20d50a1 rf9425006  
    400400        page_mask_t mask;
    401401        entry_lo_t lo0, lo1;
    402         entry_hi_t hi;
     402        entry_hi_t hi, hi_save;
    403403        int i;
     404
     405        hi_save.value = cp0_entry_hi_read();
    404406
    405407        printf("TLB:\n");
     
    418420                       lo1.g, lo1.v, lo1.d, lo1.c, lo1.pfn);
    419421        }
     422       
     423        cp0_entry_hi_write(hi_save.value);
    420424}
    421425
     
    425429        ipl_t ipl;
    426430        entry_lo_t lo0, lo1;
     431        entry_hi_t hi_save;
    427432        int i;
    428433
     434        hi_save.value = cp0_entry_hi_read();
    429435        ipl = interrupts_disable();
    430436
     
    446452       
    447453        interrupts_restore(ipl);
     454        cp0_entry_hi_write(hi_save.value);
    448455}
    449456
     
    456463        ipl_t ipl;
    457464        entry_lo_t lo0, lo1;
    458         entry_hi_t hi;
     465        entry_hi_t hi, hi_save;
    459466        int i;
    460467
    461468        ASSERT(asid != ASID_INVALID);
    462469
     470        hi_save.value = cp0_entry_hi_read();
    463471        ipl = interrupts_disable();
    464472       
     
    484492       
    485493        interrupts_restore(ipl);
     494        cp0_entry_hi_write(hi_save.value);
    486495}
    487496
     
    495504        ipl_t ipl;
    496505        entry_lo_t lo0, lo1;
    497         entry_hi_t hi;
     506        entry_hi_t hi, hi_save;
    498507        tlb_index_t index;
    499508
    500509        ASSERT(asid != ASID_INVALID);
    501510
     511        hi_save.value = cp0_entry_hi_read();
    502512        ipl = interrupts_disable();
    503513
     
    526536       
    527537        interrupts_restore(ipl);
    528 }
     538        cp0_entry_hi_write(hi_save.value);
     539}
  • generic/src/mm/as.c

    r20d50a1 rf9425006  
    5959
    6060/*
    61  * Here we assume that PFN (Physical Frame Numbers) space
     61 * Here we assume that PFN (Physical Frame Number) space
    6262 * is smaller than the width of index_t. UNALLOCATED_PFN
    6363 * can be then used to mark mappings wich were not
    64  * allocated a physical frame.
     64 * yet allocated a physical frame.
    6565 */
    6666#define UNALLOCATED_PFN         ((index_t) -1)
     
    142142                        /*
    143143                         * Frames will be allocated on-demand by
    144                          * as_page_fault().
     144                         * as_page_fault() or preloaded by
     145                         * as_area_load_mapping().
    145146                         */
    146147                        a->mapping[i] = UNALLOCATED_PFN;
     
    160161        spinlock_unlock(&as->lock);
    161162        interrupts_restore(ipl);
    162        
     163
    163164        return a;
    164165}
     
    181182        for (i = 0; i < a->size; i++) {
    182183                ASSERT(a->mapping[i] == UNALLOCATED_PFN);
     184                ASSERT(pfn[i] != UNALLOCATED_PFN);
    183185                a->mapping[i] = pfn[i];
    184186        }
     
    195197 * @param page Faulting page.
    196198 *
    197  * @return 0 on page fault, 1 if address space operation
     199 * @return 0 on page fault, 1 on success.
    198200 */
    199201int as_page_fault(__address page)
     
    251253                memsetb(frame, FRAME_SIZE, 0);
    252254                area->mapping[vpn] = frame / FRAME_SIZE;
     255                ASSERT(area->mapping[vpn] != UNALLOCATED_PFN);
    253256        } else {
    254257                frame = area->mapping[vpn] * FRAME_SIZE;
Note: See TracChangeset for help on using the changeset viewer.