Subversion Repositories HelenOS

Rev

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

Rev 399 Rev 403
Line 102... Line 102...
102
     * Record access to PTE.
102
     * Record access to PTE.
103
     */
103
     */
104
    pte->a = 1;
104
    pte->a = 1;
105
 
105
 
106
    prepare_entry_hi(&hi, VM->asid, badvaddr);
106
    prepare_entry_hi(&hi, VM->asid, badvaddr);
107
    prepare_entry_lo(&lo, pte->g, pte->v, pte->d, pte->c, pte->pfn);
107
    prepare_entry_lo(&lo, pte->lo.g, pte->lo.v, pte->lo.d, pte->lo.c, pte->lo.pfn);
108
 
108
 
109
    /*
109
    /*
110
     * New entry is to be inserted into TLB
110
     * New entry is to be inserted into TLB
111
     */
111
     */
112
    cp0_entry_hi_write(hi.value);
112
    cp0_entry_hi_write(hi.value);
Line 175... Line 175...
175
    /*
175
    /*
176
     * Record access to PTE.
176
     * Record access to PTE.
177
     */
177
     */
178
    pte->a = 1;
178
    pte->a = 1;
179
 
179
 
180
    prepare_entry_lo(&lo, pte->g, pte->v, pte->d, pte->c, pte->pfn);
180
    prepare_entry_lo(&lo, pte->lo.g, pte->lo.v, pte->lo.d, pte->lo.c, pte->lo.pfn);
181
 
181
 
182
    /*
182
    /*
183
     * The entry is to be updated in TLB.
183
     * The entry is to be updated in TLB.
184
     */
184
     */
185
    if ((badvaddr/PAGE_SIZE) % 2 == 0)
185
    if ((badvaddr/PAGE_SIZE) % 2 == 0)
Line 248... Line 248...
248
 
248
 
249
    /*
249
    /*
250
     * Record access and write to PTE.
250
     * Record access and write to PTE.
251
     */
251
     */
252
    pte->a = 1;
252
    pte->a = 1;
253
    pte->d = 1;
253
    pte->lo.d = 1;
254
 
254
 
255
    prepare_entry_lo(&lo, pte->g, pte->v, pte->w, pte->c, pte->pfn);
255
    prepare_entry_lo(&lo, pte->lo.g, pte->lo.v, pte->w, pte->lo.c, pte->lo.pfn);
256
 
256
 
257
    /*
257
    /*
258
     * The entry is to be updated in TLB.
258
     * The entry is to be updated in TLB.
259
     */
259
     */
260
    if ((badvaddr/PAGE_SIZE) % 2 == 0)
260
    if ((badvaddr/PAGE_SIZE) % 2 == 0)
Line 373... Line 373...
373
    }
373
    }
374
 
374
 
375
    /*
375
    /*
376
     * Handler cannot succeed if the mapping is marked as invalid.
376
     * Handler cannot succeed if the mapping is marked as invalid.
377
     */
377
     */
378
    if (!pte->v) {
378
    if (!pte->lo.v) {
379
        printf("Invalid mapping.\n");
379
        printf("Invalid mapping.\n");
380
        return NULL;
380
        return NULL;
381
    }
381
    }
382
 
382
 
383
    return pte;
383
    return pte;