Changeset 42f60375 in mainline
- Timestamp:
- 2011-11-20T18:36:49Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a4ac81b
- Parents:
- 2686705
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mm/frame.c
r2686705 r42f60375 131 131 } 132 132 133 static void frame_add_region(pfn_t start_frame, pfn_t end_frame) 134 { 135 if (end_frame > start_frame) { 136 /* Convert 1M frames to 16K frames */ 137 pfn_t first = ADDR2PFN(start_frame << ZERO_PAGE_WIDTH); 138 pfn_t count = ADDR2PFN((end_frame - start_frame) << ZERO_PAGE_WIDTH); 139 133 static void frame_add_region(pfn_t start_frame, pfn_t end_frame, bool low) 134 { 135 if (end_frame <= start_frame) 136 return; 137 138 uintptr_t base = start_frame << ZERO_PAGE_WIDTH; 139 size_t size = (end_frame - start_frame) << ZERO_PAGE_WIDTH; 140 141 if (!frame_adjust_zone_bounds(low, &base, &size)) 142 return; 143 144 pfn_t first = ADDR2PFN(base); 145 size_t count = SIZE2FRAMES(size); 146 pfn_t conf_frame; 147 148 if (low) { 140 149 /* Interrupt vector frame is blacklisted */ 141 pfn_t conf_frame;142 150 if (first == 0) 143 151 conf_frame = 1; 144 152 else 145 153 conf_frame = first; 146 147 zone_create(first, count, conf_frame, 0); 148 149 if (phys_regions_count < MAX_REGIONS) { 150 phys_regions[phys_regions_count].start = first; 151 phys_regions[phys_regions_count].count = count; 152 phys_regions_count++; 153 } 154 zone_create(first, count, conf_frame, 155 ZONE_AVAILABLE | ZONE_LOWMEM); 156 } else { 157 conf_frame = zone_external_conf_alloc(count); 158 zone_create(first, count, conf_frame, 159 ZONE_AVAILABLE | ZONE_HIGHMEM); 160 } 161 162 163 if (phys_regions_count < MAX_REGIONS) { 164 phys_regions[phys_regions_count].start = first; 165 phys_regions[phys_regions_count].count = count; 166 phys_regions_count++; 154 167 } 155 168 } … … 224 237 225 238 if (!avail) { 226 frame_add_region(start_frame, frame );239 frame_add_region(start_frame, frame, true); 227 240 start_frame = frame + 1; 228 241 avail = true; … … 230 243 } 231 244 232 frame_add_region(start_frame, frame );245 frame_add_region(start_frame, frame, true); 233 246 234 247 /* Blacklist interrupt vector frame */
Note:
See TracChangeset
for help on using the changeset viewer.