Changeset 454f1da in mainline for kernel/generic/src/mm/backend_elf.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_elf.c
r4638401 r454f1da 82 82 uintptr_t base, frame; 83 83 index_t i; 84 bool dirty = false; 84 85 85 86 if (!as_area_check_access(area, access)) … … 148 149 memcpy((void *) PA2KA(frame), 149 150 (void *) (base + i * FRAME_SIZE), FRAME_SIZE); 150 151 dirty = true; 152 151 153 if (area->sh_info) { 152 154 frame_reference_add(ADDR2PFN(frame)); … … 169 171 frame = (uintptr_t)frame_alloc(ONE_FRAME, 0); 170 172 memsetb(PA2KA(frame), FRAME_SIZE, 0); 173 dirty = true; 171 174 172 175 if (area->sh_info) { … … 189 192 memcpy((void *) PA2KA(frame), (void *) (base + i * FRAME_SIZE), 190 193 size); 194 dirty = true; 191 195 192 196 if (area->sh_info) { … … 205 209 if (!used_space_insert(area, ALIGN_DOWN(addr, PAGE_SIZE), 1)) 206 210 panic("Could not insert used space.\n"); 211 212 #ifdef CONFIG_VIRT_IDX_DCACHE 213 if (dirty && PAGE_COLOR(PA2KA(frame)) != PAGE_COLOR(addr)) { 214 /* 215 * By writing to the frame using kernel virtual address, 216 * we have created an illegal virtual alias. We now have to 217 * invalidate cachelines belonging to addr on all processors 218 * so that they will be reloaded with the new content on next 219 * read. 220 */ 221 dcache_flush_frame(addr, frame); 222 dcache_shootdown_start(DCACHE_INVL_FRAME, PAGE_COLOR(addr), frame); 223 dcache_shootdown_finalize(); 224 } 225 #endif 207 226 208 227 return AS_PF_OK; … … 239 258 */ 240 259 frame_free(frame); 241 #ifdef CONFIG_VIRT_IDX_DCACHE242 dcache_flush_frame(page, frame);243 #endif244 260 } 245 261 } else { … … 248 264 * lower part is backed by the ELF image and the upper is 249 265 * anonymous). In any case, a frame needs to be freed. 250 */ 251 frame_free(frame); 252 #ifdef CONFIG_VIRT_IDX_DCACHE 253 dcache_flush_frame(page, frame); 254 #endif 266 */ 267 frame_free(frame); 255 268 } 256 269 }
Note:
See TracChangeset
for help on using the changeset viewer.