Changeset 454f1da in mainline for kernel/generic/src/mm/backend_anon.c
- Timestamp:
- 2007-03-26T19:35:28Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d7daff
- Parents:
- 4638401
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_anon.c
r4638401 r454f1da 79 79 { 80 80 uintptr_t frame; 81 bool dirty = false; 81 82 82 83 if (!as_area_check_access(area, access)) … … 95 96 mutex_lock(&area->sh_info->lock); 96 97 frame = (uintptr_t) btree_search(&area->sh_info->pagemap, 97 98 ALIGN_DOWN(addr, PAGE_SIZE) - area->base, &leaf); 98 99 if (!frame) { 99 100 bool allocate = true; … … 114 115 frame = (uintptr_t) frame_alloc(ONE_FRAME, 0); 115 116 memsetb(PA2KA(frame), FRAME_SIZE, 0); 117 dirty = true; 116 118 117 119 /* … … 144 146 frame = (uintptr_t) frame_alloc(ONE_FRAME, 0); 145 147 memsetb(PA2KA(frame), FRAME_SIZE, 0); 148 dirty = true; 146 149 } 147 150 … … 155 158 panic("Could not insert used space.\n"); 156 159 160 #ifdef CONFIG_VIRT_IDX_DCACHE 161 if (dirty && PAGE_COLOR(PA2KA(frame)) != PAGE_COLOR(addr)) { 162 /* 163 * By writing to the frame using kernel virtual address, 164 * we have created an illegal virtual alias. We now have to 165 * invalidate cachelines belonging to addr on all processors 166 * so that they will be reloaded with the new content on next 167 * read. 168 */ 169 dcache_flush_frame(addr, frame); 170 dcache_shootdown_start(DCACHE_INVL_FRAME, PAGE_COLOR(addr), frame); 171 dcache_shootdown_finalize(); 172 } 173 #endif 174 157 175 return AS_PF_OK; 158 176 } … … 169 187 { 170 188 frame_free(frame); 171 #ifdef CONFIG_VIRT_IDX_DCACHE172 dcache_flush_frame(page, frame);173 #endif174 189 } 175 190 … … 218 233 frame_reference_add(pfn); 219 234 } 220 235 221 236 } 222 237 }
Note:
See TracChangeset
for help on using the changeset viewer.