Changeset 3a4ac81b in mainline
- Timestamp:
- 2011-11-20T22:34:04Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7978177c
- Parents:
- 42f60375
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips64/src/mm/frame.c
r42f60375 r3a4ac81b 123 123 } 124 124 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 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) { 132 141 /* Interrupt vector frame is blacklisted */ 133 pfn_t conf_frame;134 142 if (first == 0) 135 143 conf_frame = 1; 136 144 else 137 145 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 zone_create(first, count, conf_frame, 151 ZONE_AVAILABLE | ZONE_HIGHMEM); 152 } 138 153 139 zone_create(first, count, conf_frame, 0);140 154 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 } 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++; 146 159 } 147 160 } … … 207 220 208 221 if (!avail) { 209 frame_add_region(start_frame, frame );222 frame_add_region(start_frame, frame, true); 210 223 start_frame = frame + 1; 211 224 avail = true; … … 213 226 } 214 227 215 frame_add_region(start_frame, frame );228 frame_add_region(start_frame, frame, true); 216 229 217 230 /* Blacklist interrupt vector frame */
Note:
See TracChangeset
for help on using the changeset viewer.