Changeset f9425006 in mainline for generic/src/mm/as.c
- Timestamp:
- 2006-01-13T16:29:20Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 214e89e3
- Parents:
- 20d50a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/as.c
r20d50a1 rf9425006 59 59 60 60 /* 61 * Here we assume that PFN (Physical Frame Number s) space61 * Here we assume that PFN (Physical Frame Number) space 62 62 * is smaller than the width of index_t. UNALLOCATED_PFN 63 63 * can be then used to mark mappings wich were not 64 * allocated a physical frame.64 * yet allocated a physical frame. 65 65 */ 66 66 #define UNALLOCATED_PFN ((index_t) -1) … … 142 142 /* 143 143 * Frames will be allocated on-demand by 144 * as_page_fault(). 144 * as_page_fault() or preloaded by 145 * as_area_load_mapping(). 145 146 */ 146 147 a->mapping[i] = UNALLOCATED_PFN; … … 160 161 spinlock_unlock(&as->lock); 161 162 interrupts_restore(ipl); 162 163 163 164 return a; 164 165 } … … 181 182 for (i = 0; i < a->size; i++) { 182 183 ASSERT(a->mapping[i] == UNALLOCATED_PFN); 184 ASSERT(pfn[i] != UNALLOCATED_PFN); 183 185 a->mapping[i] = pfn[i]; 184 186 } … … 195 197 * @param page Faulting page. 196 198 * 197 * @return 0 on page fault, 1 if address space operation199 * @return 0 on page fault, 1 on success. 198 200 */ 199 201 int as_page_fault(__address page) … … 251 253 memsetb(frame, FRAME_SIZE, 0); 252 254 area->mapping[vpn] = frame / FRAME_SIZE; 255 ASSERT(area->mapping[vpn] != UNALLOCATED_PFN); 253 256 } else { 254 257 frame = area->mapping[vpn] * FRAME_SIZE;
Note:
See TracChangeset
for help on using the changeset viewer.