Changeset 402eda5 in mainline
- Timestamp:
- 2010-06-22T12:19:45Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9539be6
- Parents:
- a49a1a1
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/mm/asid.c
ra49a1a1 r402eda5 126 126 * Get the system rid of the stolen ASID. 127 127 */ 128 tlb_shootdown_start(TLB_INVL_ASID, asid, 0, 0);128 ipl_t ipl = tlb_shootdown_start(TLB_INVL_ASID, asid, 0, 0); 129 129 tlb_invalidate_asid(asid); 130 tlb_shootdown_finalize( );130 tlb_shootdown_finalize(ipl); 131 131 } else { 132 132 … … 142 142 * Purge the allocated ASID from TLBs. 143 143 */ 144 tlb_shootdown_start(TLB_INVL_ASID, asid, 0, 0);144 ipl_t ipl = tlb_shootdown_start(TLB_INVL_ASID, asid, 0, 0); 145 145 tlb_invalidate_asid(asid); 146 tlb_shootdown_finalize( );146 tlb_shootdown_finalize(ipl); 147 147 } 148 148 -
kernel/generic/include/mm/tlb.h
ra49a1a1 r402eda5 68 68 69 69 #ifdef CONFIG_SMP 70 extern void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,71 uintptr_t page, size_t count);72 extern void tlb_shootdown_finalize( void);70 extern ipl_t tlb_shootdown_start(tlb_invalidate_type_t, asid_t, uintptr_t, 71 size_t); 72 extern void tlb_shootdown_finalize(ipl_t); 73 73 extern void tlb_shootdown_ipi_recv(void); 74 74 #else 75 #define tlb_shootdown_start(w, x, y, z) 76 #define tlb_shootdown_finalize( )75 #define tlb_shootdown_start(w, x, y, z) (0) 76 #define tlb_shootdown_finalize(i) ((i) = (i)); 77 77 #define tlb_shootdown_ipi_recv() 78 78 #endif /* CONFIG_SMP */ … … 84 84 85 85 extern void tlb_invalidate_all(void); 86 extern void tlb_invalidate_asid(asid_t asid);87 extern void tlb_invalidate_pages(asid_t asid, uintptr_t page, size_t cnt);86 extern void tlb_invalidate_asid(asid_t); 87 extern void tlb_invalidate_pages(asid_t, uintptr_t, size_t); 88 88 #endif 89 89 -
kernel/generic/src/mm/as.c
ra49a1a1 r402eda5 433 433 * 434 434 */ 435 tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base +436 pages * PAGE_SIZE, area->pages - pages);435 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, 436 area->base + pages * PAGE_SIZE, area->pages - pages); 437 437 438 438 /* … … 528 528 as_invalidate_translation_cache(as, area->base + 529 529 pages * PAGE_SIZE, area->pages - pages); 530 tlb_shootdown_finalize( );530 tlb_shootdown_finalize(ipl); 531 531 532 532 page_table_unlock(as, false); … … 578 578 * Start TLB shootdown sequence. 579 579 */ 580 tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, area->pages); 580 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, 581 area->pages); 581 582 582 583 /* … … 625 626 */ 626 627 as_invalidate_translation_cache(as, area->base, area->pages); 627 tlb_shootdown_finalize( );628 tlb_shootdown_finalize(ipl); 628 629 629 630 page_table_unlock(as, false); … … 865 866 * 866 867 */ 867 tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, area->pages); 868 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, 869 area->pages); 868 870 869 871 /* … … 912 914 */ 913 915 as_invalidate_translation_cache(as, area->base, area->pages); 914 tlb_shootdown_finalize( );916 tlb_shootdown_finalize(ipl); 915 917 916 918 page_table_unlock(as, false); -
kernel/generic/src/mm/tlb.c
ra49a1a1 r402eda5 73 73 * to all other processors. 74 74 * 75 * @param type 76 * @param asid 77 * @param page 78 * @param count 75 * @param type Type describing scope of shootdown. 76 * @param asid Address space, if required by type. 77 * @param page Virtual page address, if required by type. 78 * @param count Number of pages, if required by type. 79 79 * 80 * @return The interrupt priority level as it existed prior to this call. 80 81 */ 81 voidtlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,82 ipl_t tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid, 82 83 uintptr_t page, size_t count) 83 84 { 85 ipl_t ipl; 86 87 ipl = interrupts_disable(); 84 88 CPU->tlb_active = false; 85 irq_spinlock_lock(&tlblock, true);89 irq_spinlock_lock(&tlblock, false); 86 90 87 91 size_t i; … … 123 127 if (cpus[i].tlb_active) 124 128 goto busy_wait; 129 130 return ipl; 125 131 } 126 132 127 133 /** Finish TLB shootdown sequence. 128 134 * 135 * @param ipl Previous interrupt priority level. 129 136 */ 130 void tlb_shootdown_finalize( void)137 void tlb_shootdown_finalize(ipl_t ipl) 131 138 { 132 irq_spinlock_unlock(&tlblock, true);139 irq_spinlock_unlock(&tlblock, false); 133 140 CPU->tlb_active = true; 141 interrupts_restore(ipl); 134 142 } 135 143
Note:
See TracChangeset
for help on using the changeset viewer.