Changeset a98d2ec in mainline
- Timestamp:
- 2005-12-11T14:00:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dd14cced
- Parents:
- 7910cff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/src/mm/tlb.c
r7910cff ra98d2ec 56 56 void tlb_arch_init(void) 57 57 { 58 int i;59 60 58 cp0_pagemask_write(TLB_PAGE_MASK_16K); 61 cp0_entry_hi_write(0); 62 cp0_entry_lo0_write(0); 63 cp0_entry_lo1_write(0); 64 65 /* 66 * Invalidate all entries. 67 */ 68 for (i = 0; i < TLB_ENTRY_COUNT; i++) { 69 cp0_index_write(i); 70 tlbwi(); 71 } 72 59 60 tlb_invalidate_all(); 61 73 62 /* 74 63 * The kernel is going to make use of some wired … … 410 399 for (i = 0; i < TLB_ENTRY_COUNT; i++) { 411 400 cp0_index_write(i); 412 413 401 tlbr(); 414 402 … … 423 411 } 424 412 } 413 414 /** Invalidate all TLB entries. */ 415 void tlb_invalidate_all(void) 416 { 417 int i; 418 419 cp0_entry_hi_write(0); 420 cp0_entry_lo0_write(0); 421 cp0_entry_lo1_write(0); 422 423 for (i = 0; i < TLB_ENTRY_COUNT; i++) { 424 cp0_index_write(i); 425 tlbwi(); 426 } 427 } 428 429 /** Invalidate all TLB entries belonging to specified address space. 430 * 431 * @param asid Address space identifier. 432 */ 433 void tlb_invalidate_asid(asid_t asid) 434 { 435 entry_hi_t hi; 436 int i; 437 438 for (i = 0; i < TLB_ENTRY_COUNT; i++) { 439 cp0_index_write(i); 440 tlbr(); 441 442 if (hi.asid == asid) { 443 cp0_entry_lo0_write(0); 444 cp0_entry_lo1_write(0); 445 tlbwi(); 446 } 447 } 448 449 } 450 451 /** Invalidate TLB entry for specified page belonging to specified address space. 452 * 453 * @param asid Address space identifier. 454 * @param page Page whose TLB entry is to be invalidated. 455 */ 456 void tlb_invalidate_page(asid_t asid, __address page) 457 { 458 entry_hi_t hi; 459 tlb_index_t index; 460 int i; 461 462 hi.value = 0; 463 prepare_entry_hi(&hi, asid, page); 464 465 tlbp(); 466 index.value = cp0_index_read(); 467 468 if (!index.p) { 469 /* Entry was found, index register contains valid index. */ 470 cp0_entry_lo0_write(0); 471 cp0_entry_lo1_write(0); 472 tlbwi(); 473 } 474 }
Note:
See TracChangeset
for help on using the changeset viewer.