Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 5 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | 28 | ||
29 | #include <mm/vm.h> |
29 | #include <mm/vm.h> |
30 | #include <mm/page.h> |
30 | #include <mm/page.h> |
31 | #include <mm/frame.h> |
31 | #include <mm/frame.h> |
- | 32 | #include <mm/tlb.h> |
|
32 | #include <arch/mm/page.h> |
33 | #include <arch/mm/page.h> |
33 | #include <arch/types.h> |
34 | #include <arch/types.h> |
34 | #include <typedefs.h> |
35 | #include <typedefs.h> |
35 | #include <synch/spinlock.h> |
36 | #include <synch/spinlock.h> |
36 | #include <config.h> |
37 | #include <config.h> |
Line 140... | Line 141... | ||
140 | pri = cpu_priority_high(); |
141 | pri = cpu_priority_high(); |
141 | spinlock_lock(&a->lock); |
142 | spinlock_lock(&a->lock); |
142 | 143 | ||
143 | for (i=0; i<a->size; i++) |
144 | for (i=0; i<a->size; i++) |
144 | map_page_to_frame(a->address + i*PAGE_SIZE, 0, PAGE_NOT_PRESENT, 0); |
145 | map_page_to_frame(a->address + i*PAGE_SIZE, 0, PAGE_NOT_PRESENT, 0); |
145 | 146 | ||
146 | spinlock_unlock(&a->lock); |
147 | spinlock_unlock(&a->lock); |
147 | cpu_priority_restore(pri); |
148 | cpu_priority_restore(pri); |
148 | } |
149 | } |
149 | 150 | ||
150 | void vm_install(vm_t *m) |
151 | void vm_install(vm_t *m) |
Line 166... | Line 167... | ||
166 | { |
167 | { |
167 | link_t *l; |
168 | link_t *l; |
168 | pri_t pri; |
169 | pri_t pri; |
169 | 170 | ||
170 | pri = cpu_priority_high(); |
171 | pri = cpu_priority_high(); |
- | 172 | ||
- | 173 | tlb_shutdown_start(); |
|
- | 174 | ||
171 | spinlock_lock(&m->lock); |
175 | spinlock_lock(&m->lock); |
172 | 176 | ||
173 | for(l = m->vm_area_head.next; l != &m->vm_area_head; l = l->next) |
177 | for(l = m->vm_area_head.next; l != &m->vm_area_head; l = l->next) |
174 | vm_area_unmap(list_get_instance(l, vm_area_t, link)); |
178 | vm_area_unmap(list_get_instance(l, vm_area_t, link)); |
175 | 179 | ||
176 | spinlock_unlock(&m->lock); |
180 | spinlock_unlock(&m->lock); |
- | 181 | ||
- | 182 | tlb_invalidate(0); |
|
- | 183 | tlb_shutdown_finalize(); |
|
- | 184 | ||
177 | cpu_priority_restore(pri); |
185 | cpu_priority_restore(pri); |
178 | } |
186 | } |