- Timestamp:
- 2005-02-21T21:47:22Z (21 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b109ebb
- Parents:
- 0ded477
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/main.c
r0ded477 r169587a 47 47 #include <mm/frame.h> 48 48 #include <mm/page.h> 49 #include <mm/tlb.h> 49 50 #include <synch/waitq.h> 50 51 … … 111 112 frame_init(); 112 113 page_init(); 114 tlb_init(); 113 115 114 116 #ifdef __SMP__ -
src/mm/tlb.c
r0ded477 r169587a 28 28 29 29 #include <mm/tlb.h> 30 #include <synch/spinlock.h> 31 #include <typedefs.h> 32 #include <arch/atomic.h> 33 #include <config.h> 30 34 31 void tlb_shutdown(void) 35 #ifdef __SMP__ 36 static spinlock_t tlblock; 37 static volatile int tlb_shutdown_cnt; 38 39 void tlb_init(void) 32 40 { 33 /* TODO: implement tlb_shutdown */ 41 spinlock_initialize(&tlblock); 42 tlb_shutdown_cnt = 0; 34 43 } 44 45 /* must be called with interrupts disabled */ 46 void tlb_shutdown_start(void) 47 { 48 spinlock_lock(&tlblock); 49 tlb_shutdown_ipi_send(); 50 51 while (tlb_shutdown_cnt < config.cpu_active - 1) 52 ; 53 54 tlb_shutdown_cnt = 0; 55 } 56 57 void tlb_shutdown_finalize(void) 58 { 59 spinlock_unlock(&tlblock); 60 } 61 62 void tlb_shutdown_ipi_recv(void) 63 { 64 atomic_inc((int *) &tlb_shutdown_cnt); 65 spinlock_lock(&tlblock); 66 spinlock_unlock(&tlblock); 67 tlb_invalidate(0); /* TODO: use valid ASID */ 68 } 69 #endif /* __SMP__ */ -
src/mm/vm.c
r0ded477 r169587a 30 30 #include <mm/page.h> 31 31 #include <mm/frame.h> 32 #include <mm/tlb.h> 32 33 #include <arch/mm/page.h> 33 34 #include <arch/types.h> … … 143 144 for (i=0; i<a->size; i++) 144 145 map_page_to_frame(a->address + i*PAGE_SIZE, 0, PAGE_NOT_PRESENT, 0); 145 146 146 147 spinlock_unlock(&a->lock); 147 148 cpu_priority_restore(pri); … … 169 170 170 171 pri = cpu_priority_high(); 172 173 tlb_shutdown_start(); 174 171 175 spinlock_lock(&m->lock); 172 176 … … 175 179 176 180 spinlock_unlock(&m->lock); 181 182 tlb_invalidate(0); 183 tlb_shutdown_finalize(); 184 177 185 cpu_priority_restore(pri); 178 186 }
Note:
See TracChangeset
for help on using the changeset viewer.