Changes in kernel/arch/mips64/src/mm/frame.c [4dee0cb:2429e4a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips64/src/mm/frame.c
r4dee0cb r2429e4a 115 115 for (i = 0; i < init.cnt; i++) 116 116 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE, 117 init.tasks[i].paddr, init.tasks[i].size)) {117 KA2PA(init.tasks[i].addr), init.tasks[i].size)) { 118 118 safe = false; 119 119 break; … … 123 123 } 124 124 125 static void frame_add_region(pfn_t start_frame, pfn_t end_frame, bool low) 126 { 127 if (end_frame <= start_frame) 128 return; 129 130 uintptr_t base = start_frame << ZERO_PAGE_WIDTH; 131 size_t size = (end_frame - start_frame) << ZERO_PAGE_WIDTH; 132 133 if (!frame_adjust_zone_bounds(low, &base, &size)) 134 return; 135 136 pfn_t first = ADDR2PFN(base); 137 size_t count = SIZE2FRAMES(size); 138 pfn_t conf_frame; 139 140 if (low) { 125 static void frame_add_region(pfn_t start_frame, pfn_t end_frame) 126 { 127 if (end_frame > start_frame) { 128 /* Convert 1M frames to 16K frames */ 129 pfn_t first = ADDR2PFN(start_frame << ZERO_PAGE_WIDTH); 130 pfn_t count = ADDR2PFN((end_frame - start_frame) << ZERO_PAGE_WIDTH); 131 141 132 /* Interrupt vector frame is blacklisted */ 133 pfn_t conf_frame; 142 134 if (first == 0) 143 135 conf_frame = 1; 144 136 else 145 137 conf_frame = first; 146 zone_create(first, count, conf_frame, 147 ZONE_AVAILABLE | ZONE_LOWMEM); 148 } else { 149 conf_frame = zone_external_conf_alloc(count); 150 if (conf_frame != 0) 151 zone_create(first, count, conf_frame, 152 ZONE_AVAILABLE | ZONE_HIGHMEM); 153 } 154 155 if (phys_regions_count < MAX_REGIONS) { 156 phys_regions[phys_regions_count].start = first; 157 phys_regions[phys_regions_count].count = count; 158 phys_regions_count++; 138 139 zone_create(first, count, conf_frame, 0); 140 141 if (phys_regions_count < MAX_REGIONS) { 142 phys_regions[phys_regions_count].start = first; 143 phys_regions[phys_regions_count].count = count; 144 phys_regions_count++; 145 } 159 146 } 160 147 } … … 169 156 * 170 157 */ 171 void frame_ low_arch_init(void)158 void frame_arch_init(void) 172 159 { 173 160 ipl_t ipl = interrupts_disable(); … … 220 207 221 208 if (!avail) { 222 frame_add_region(start_frame, frame , true);209 frame_add_region(start_frame, frame); 223 210 start_frame = frame + 1; 224 211 avail = true; … … 226 213 } 227 214 228 frame_add_region(start_frame, frame , true);215 frame_add_region(start_frame, frame); 229 216 230 217 /* Blacklist interrupt vector frame */ … … 242 229 } 243 230 244 void frame_high_arch_init(void)245 {246 }247 248 231 void physmem_print(void) 249 232 {
Note:
See TracChangeset
for help on using the changeset viewer.