Subversion Repositories HelenOS

Rev

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

Rev 3856 Rev 3857
Line 225... Line 225...
225
    phte[base + i].wimg = (pte->page_cache_disable ? WIMG_NO_CACHE : 0);
225
    phte[base + i].wimg = (pte->page_cache_disable ? WIMG_NO_CACHE : 0);
226
    phte[base + i].pp = 2; // FIXME
226
    phte[base + i].pp = 2; // FIXME
227
}
227
}
228
 
228
 
229
 
229
 
230
/** Process Instruction/Data Storage Interrupt
230
/** Process Instruction/Data Storage Exception
231
 *
231
 *
232
 * @param n     Interrupt vector number.
232
 * @param n      Exception vector number.
233
 * @param istate    Interrupted register context.
233
 * @param istate Interrupted register context.
234
 *
234
 *
235
 */
235
 */
236
void pht_refill(int n, istate_t *istate)
236
void pht_refill(int n, istate_t *istate)
237
{
237
{
238
    uintptr_t badvaddr;
238
    uintptr_t badvaddr;
Line 285... Line 285...
285
    page_table_unlock(as, lock);
285
    page_table_unlock(as, lock);
286
    pht_refill_fail(badvaddr, istate);
286
    pht_refill_fail(badvaddr, istate);
287
}
287
}
288
 
288
 
289
 
289
 
290
/** Process Instruction/Data Storage Interrupt in Real Mode
290
/** Process Instruction/Data Storage Exception in Real Mode
291
 *
291
 *
292
 * @param n     Interrupt vector number.
292
 * @param n      Exception vector number.
293
 * @param istate    Interrupted register context.
293
 * @param istate Interrupted register context.
294
 *
294
 *
295
 */
295
 */
296
bool pht_refill_real(int n, istate_t *istate)
296
bool pht_refill_real(int n, istate_t *istate)
297
{
297
{
298
    uintptr_t badvaddr;
298
    uintptr_t badvaddr;
Line 406... Line 406...
406
   
406
   
407
    return true;
407
    return true;
408
}
408
}
409
 
409
 
410
 
410
 
-
 
411
/** Process ITLB/DTLB Miss Exception in Real Mode
-
 
412
 *
-
 
413
 *
-
 
414
 */
-
 
415
void tlb_refill_real(int n, uint32_t tlbmiss, ptehi_t ptehi, ptelo_t ptelo, istate_t *istate)
-
 
416
{
-
 
417
    uint32_t badvaddr = tlbmiss & 0xfffffffc;
-
 
418
   
-
 
419
    uint32_t physmem;
-
 
420
    asm volatile (
-
 
421
        "mfsprg3 %0\n"
-
 
422
        : "=r" (physmem)
-
 
423
    );
-
 
424
   
-
 
425
    if ((badvaddr < PA2KA(0)) || (badvaddr >= PA2KA(physmem)))
-
 
426
        return; // FIXME
-
 
427
   
-
 
428
    ptelo.rpn = KA2PA(badvaddr) >> 12;
-
 
429
    ptelo.wimg = 0;
-
 
430
    ptelo.pp = 2; // FIXME
-
 
431
   
-
 
432
    uint32_t index = 0;
-
 
433
    asm volatile (
-
 
434
        "mtspr 981, %0\n"
-
 
435
        "mtspr 982, %1\n"
-
 
436
        "tlbld %2\n"
-
 
437
        "tlbli %2\n"
-
 
438
        : "=r" (index)
-
 
439
        : "r" (ptehi),
-
 
440
          "r" (ptelo)
-
 
441
    );
-
 
442
}
-
 
443
 
-
 
444
 
411
void tlb_arch_init(void)
445
void tlb_arch_init(void)
412
{
446
{
413
    tlb_invalidate_all();
447
    tlb_invalidate_all();
414
}
448
}
415
 
449