Changes in kernel/arch/mips32/src/mm/frame.c [32817cc:933cadf] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mm/frame.c
r32817cc r933cadf 123 123 for (i = 0; i < init.cnt; i++) 124 124 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE, 125 init.tasks[i].paddr, init.tasks[i].size)) {125 KA2PA(init.tasks[i].addr), init.tasks[i].size)) { 126 126 safe = false; 127 127 break; … … 131 131 } 132 132 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) { 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 149 140 /* Interrupt vector frame is blacklisted */ 141 pfn_t conf_frame; 150 142 if (first == 0) 151 143 conf_frame = 1; 152 144 else 153 145 conf_frame = first; 154 zone_create(first, count, conf_frame, 155 ZONE_AVAILABLE | ZONE_LOWMEM); 156 } else { 157 conf_frame = zone_external_conf_alloc(count); 158 if (conf_frame != 0) 159 zone_create(first, count, conf_frame, 160 ZONE_AVAILABLE | ZONE_HIGHMEM); 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++; 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 } 167 154 } 168 155 } … … 178 165 * 179 166 */ 180 void frame_ low_arch_init(void)167 void frame_arch_init(void) 181 168 { 182 169 ipl_t ipl = interrupts_disable(); … … 237 224 238 225 if (!avail) { 239 frame_add_region(start_frame, frame , true);226 frame_add_region(start_frame, frame); 240 227 start_frame = frame + 1; 241 228 avail = true; … … 243 230 } 244 231 245 frame_add_region(start_frame, frame , true);232 frame_add_region(start_frame, frame); 246 233 247 234 /* Blacklist interrupt vector frame */ … … 259 246 } 260 247 261 void frame_high_arch_init(void)262 {263 }264 248 265 249 void physmem_print(void)
Note:
See TracChangeset
for help on using the changeset viewer.