Changes in kernel/generic/src/mm/backend_elf.c [38dc82d:59fb782] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/backend_elf.c
r38dc82d r59fb782 75 75 .page_fault = elf_page_fault, 76 76 .frame_free = elf_frame_free, 77 78 .create_shared_data = NULL,79 .destroy_shared_data = NULL80 77 }; 81 78 … … 184 181 185 182 for (j = 0; j < count; j++) { 186 pte_t pte; 187 bool found; 183 pte_t *pte; 188 184 189 185 /* … … 197 193 198 194 page_table_lock(area->as, false); 199 found = page_mapping_find(area->as, 200 base + P2SZ(j), false, &pte); 201 202 ASSERT(found); 203 ASSERT(PTE_VALID(&pte)); 204 ASSERT(PTE_PRESENT(&pte)); 205 195 pte = page_mapping_find(area->as, 196 base + P2SZ(j), false); 197 ASSERT(pte && PTE_VALID(pte) && 198 PTE_PRESENT(pte)); 206 199 btree_insert(&area->sh_info->pagemap, 207 200 (base + P2SZ(j)) - area->base, 208 (void *) PTE_GET_FRAME( &pte), NULL);201 (void *) PTE_GET_FRAME(pte), NULL); 209 202 page_table_unlock(area->as, false); 210 203 211 pfn_t pfn = ADDR2PFN(PTE_GET_FRAME( &pte));204 pfn_t pfn = ADDR2PFN(PTE_GET_FRAME(pte)); 212 205 frame_reference_add(pfn); 213 206 } … … 281 274 start_anon = entry->p_vaddr + entry->p_filesz; 282 275 283 mutex_lock(&area->sh_info->lock); 284 if (area->sh_info->shared) { 276 if (area->sh_info) { 285 277 bool found = false; 286 278 … … 289 281 */ 290 282 283 mutex_lock(&area->sh_info->lock); 291 284 frame = (uintptr_t) btree_search(&area->sh_info->pagemap, 292 285 upage - area->base, &leaf); … … 339 332 dirty = true; 340 333 } else { 341 pte_t pte; 342 bool found; 343 344 found = page_mapping_find(AS_KERNEL, 345 base + i * FRAME_SIZE, true, &pte); 346 347 ASSERT(found); 348 ASSERT(PTE_PRESENT(&pte)); 349 350 frame = PTE_GET_FRAME(&pte); 334 pte_t *pte = page_mapping_find(AS_KERNEL, 335 base + i * FRAME_SIZE, true); 336 337 ASSERT(pte); 338 ASSERT(PTE_PRESENT(pte)); 339 340 frame = PTE_GET_FRAME(pte); 351 341 } 352 342 } else if (upage >= start_anon) { … … 394 384 } 395 385 396 if (dirty && area->sh_info ->shared) {386 if (dirty && area->sh_info) { 397 387 frame_reference_add(ADDR2PFN(frame)); 398 388 btree_insert(&area->sh_info->pagemap, upage - area->base, … … 400 390 } 401 391 402 mutex_unlock(&area->sh_info->lock); 392 if (area->sh_info) 393 mutex_unlock(&area->sh_info->lock); 403 394 404 395 page_mapping_insert(AS, upage, frame, as_area_get_flags(area)); … … 438 429 * data. 439 430 */ 440 frame_free_noreserve(frame , 1);431 frame_free_noreserve(frame); 441 432 } 442 433 } else { … … 446 437 * anonymous). In any case, a frame needs to be freed. 447 438 */ 448 frame_free_noreserve(frame , 1);439 frame_free_noreserve(frame); 449 440 } 450 441 }
Note:
See TracChangeset
for help on using the changeset viewer.