Changeset 8c5e6c7 in mainline for arch/mips32/src/mm/tlb.c
- Timestamp:
- 2005-10-07T23:19:56Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cad5ce8
- Parents:
- 92e5431
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/src/mm/tlb.c
r92e5431 r8c5e6c7 45 45 46 46 static pte_t *find_mapping_and_check(__address badvaddr); 47 47 48 static void prepare_entry_lo(entry_lo_t *lo, bool g, bool v, bool d, int c, __address pfn); 49 static void prepare_entry_hi(entry_hi_t *hi, asid_t asid, __address addr); 48 50 49 51 /** Initialize TLB … … 85 87 { 86 88 entry_lo_t lo; 89 entry_hi_t hi; 87 90 __address badvaddr; 88 91 pte_t *pte; 89 92 90 // debug91 entry_hi_t hi;92 93 93 badvaddr = cp0_badvaddr_read(); 94 94 95 // debug96 hi.value = cp0_entry_hi_read();97 printf("TLB Refill: hi.vnp2=%X\n", hi.vpn2);98 99 95 spinlock_lock(&VM->lock); 96 100 97 pte = find_mapping_and_check(badvaddr); 101 98 if (!pte) … … 107 104 pte->a = 1; 108 105 106 prepare_entry_hi(&hi, VM->asid, badvaddr); 109 107 prepare_entry_lo(&lo, pte->g, pte->v, pte->d, pte->c, pte->pfn); 110 108 … … 112 110 * New entry is to be inserted into TLB 113 111 */ 112 cp0_entry_hi_write(hi.value); 114 113 if ((badvaddr/PAGE_SIZE) % 2 == 0) { 115 114 cp0_entry_lo0_write(lo.value); … … 141 140 __address badvaddr; 142 141 entry_lo_t lo; 142 entry_hi_t hi; 143 143 pte_t *pte; 144 144 … … 148 148 * Locate the faulting entry in TLB. 149 149 */ 150 hi.value = cp0_entry_hi_read(); 151 prepare_entry_hi(&hi, hi.asid, badvaddr); 152 cp0_entry_hi_write(hi.value); 150 153 tlbp(); 151 154 index.value = cp0_index_read(); … … 205 208 __address badvaddr; 206 209 entry_lo_t lo; 210 entry_hi_t hi; 207 211 pte_t *pte; 208 212 … … 212 216 * Locate the faulting entry in TLB. 213 217 */ 218 hi.value = cp0_entry_hi_read(); 219 prepare_entry_hi(&hi, hi.asid, badvaddr); 220 cp0_entry_hi_write(hi.value); 214 221 tlbp(); 215 222 index.value = cp0_index_read(); … … 379 386 void prepare_entry_lo(entry_lo_t *lo, bool g, bool v, bool d, int c, __address pfn) 380 387 { 388 lo->value = 0; 381 389 lo->g = g; 382 390 lo->v = v; … … 384 392 lo->c = c; 385 393 lo->pfn = pfn; 386 lo->zero = 0; 387 } 394 } 395 396 void prepare_entry_hi(entry_hi_t *hi, asid_t asid, __address addr) 397 { 398 hi->value = (((addr/PAGE_SIZE)/2)*PAGE_SIZE*2); 399 hi->asid = asid; 400 }
Note:
See TracChangeset
for help on using the changeset viewer.