Changes in kernel/arch/mips32/src/mm/tlb.c [2bdf8313:bd81386] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mm/tlb.c
r2bdf8313 rbd81386 100 100 mutex_unlock(&AS->lock); 101 101 102 page_table_lock(AS, true); 103 102 104 pte = find_mapping_and_check(badvaddr, PF_ACCESS_READ, istate, &pfrc); 103 105 if (!pte) { … … 111 113 * or copy_to_uspace(). 112 114 */ 115 page_table_unlock(AS, true); 113 116 return; 114 117 default: … … 141 144 tlbwr(); 142 145 146 page_table_unlock(AS, true); 143 147 return; 144 148 145 149 fail: 150 page_table_unlock(AS, true); 146 151 tlb_refill_fail(istate); 147 152 } … … 171 176 index.value = cp0_index_read(); 172 177 178 page_table_lock(AS, true); 179 173 180 /* 174 181 * Fail if the entry is not in TLB. … … 190 197 * or copy_to_uspace(). 191 198 */ 199 page_table_unlock(AS, true); 192 200 return; 193 201 default: … … 219 227 tlbwi(); 220 228 229 page_table_unlock(AS, true); 221 230 return; 222 231 223 232 fail: 233 page_table_unlock(AS, true); 224 234 tlb_invalid_fail(istate); 225 235 } … … 249 259 index.value = cp0_index_read(); 250 260 261 page_table_lock(AS, true); 262 251 263 /* 252 264 * Fail if the entry is not in TLB. … … 268 280 * or copy_to_uspace(). 269 281 */ 282 page_table_unlock(AS, true); 270 283 return; 271 284 default: … … 298 311 tlbwi(); 299 312 313 page_table_unlock(AS, true); 300 314 return; 301 315 302 316 fail: 317 page_table_unlock(AS, true); 303 318 tlb_modified_fail(istate); 304 319 } … … 349 364 pte_t *pte; 350 365 366 ASSERT(mutex_locked(&AS->lock)); 367 351 368 hi.value = cp0_entry_hi_read(); 352 369 … … 362 379 * Check if the mapping exists in page tables. 363 380 */ 364 pte = page_mapping_find(AS, badvaddr , true);381 pte = page_mapping_find(AS, badvaddr); 365 382 if (pte && pte->p && (pte->w || access != PF_ACCESS_WRITE)) { 366 383 /* … … 376 393 * Resort to higher-level page fault handler. 377 394 */ 395 page_table_unlock(AS, true); 378 396 switch (rc = as_page_fault(badvaddr, access, istate)) { 379 397 case AS_PF_OK: … … 382 400 * The mapping ought to be in place. 383 401 */ 384 pte = page_mapping_find(AS, badvaddr, true); 402 page_table_lock(AS, true); 403 pte = page_mapping_find(AS, badvaddr); 385 404 ASSERT(pte && pte->p); 386 405 ASSERT(pte->w || access != PF_ACCESS_WRITE); … … 388 407 break; 389 408 case AS_PF_DEFER: 409 page_table_lock(AS, true); 390 410 *pfrc = AS_PF_DEFER; 391 411 return NULL; 392 412 break; 393 413 case AS_PF_FAULT: 414 page_table_lock(AS, true); 394 415 *pfrc = AS_PF_FAULT; 395 416 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.