Rev 1426 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1426 | Rev 1545 | ||
|---|---|---|---|
| Line 108... | Line 108... | ||
| 108 | * Insert the address of the newly allocated frame to the pagemap. |
108 | * Insert the address of the newly allocated frame to the pagemap. |
| 109 | */ |
109 | */ |
| 110 | btree_insert(&area->sh_info->pagemap, ALIGN_DOWN(addr, PAGE_SIZE) - area->base, (void *) frame, leaf); |
110 | btree_insert(&area->sh_info->pagemap, ALIGN_DOWN(addr, PAGE_SIZE) - area->base, (void *) frame, leaf); |
| 111 | } |
111 | } |
| 112 | } |
112 | } |
| - | 113 | frame_reference_add(ADDR2PFN(frame)); |
|
| 113 | mutex_unlock(&area->sh_info->lock); |
114 | mutex_unlock(&area->sh_info->lock); |
| 114 | } else { |
115 | } else { |
| 115 | 116 | ||
| 116 | /* |
117 | /* |
| 117 | * In general, there can be several reasons that |
118 | * In general, there can be several reasons that |
| Line 190... | Line 191... | ||
| 190 | pte = page_mapping_find(area->as, base + j*PAGE_SIZE); |
191 | pte = page_mapping_find(area->as, base + j*PAGE_SIZE); |
| 191 | ASSERT(pte && PTE_VALID(pte) && PTE_PRESENT(pte)); |
192 | ASSERT(pte && PTE_VALID(pte) && PTE_PRESENT(pte)); |
| 192 | btree_insert(&area->sh_info->pagemap, (base + j*PAGE_SIZE) - area->base, |
193 | btree_insert(&area->sh_info->pagemap, (base + j*PAGE_SIZE) - area->base, |
| 193 | (void *) PTE_GET_FRAME(pte), NULL); |
194 | (void *) PTE_GET_FRAME(pte), NULL); |
| 194 | page_table_unlock(area->as, false); |
195 | page_table_unlock(area->as, false); |
| - | 196 | frame_reference_add(ADDR2PFN(PTE_GET_FRAME(pte))); |
|
| 195 | } |
197 | } |
| 196 | 198 | ||
| 197 | } |
199 | } |
| 198 | } |
200 | } |
| 199 | mutex_unlock(&area->sh_info->lock); |
201 | mutex_unlock(&area->sh_info->lock); |