Changes in kernel/arch/ia64/src/mm/frame.c [40c8c17:bbe4828] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/mm/frame.c
r40c8c17 rbbe4828 51 51 #define MINCONF 1 52 52 53 static void frame_common_arch_init(bool low) 53 uintptr_t last_frame = 0; 54 55 void frame_arch_init(void) 54 56 { 55 unsigned int i; 57 if (config.cpu_active == 1) { 58 unsigned int i; 59 for (i = 0; i < bootinfo->memmap_items; i++) { 60 if (bootinfo->memmap[i].type == MEMMAP_FREE_MEM) { 61 uint64_t base = bootinfo->memmap[i].base; 62 uint64_t size = bootinfo->memmap[i].size; 63 uint64_t abase = ALIGN_UP(base, FRAME_SIZE); 56 64 57 for (i = 0; i < bootinfo->memmap_items; i++) { 58 if (bootinfo->memmap[i].type != MEMMAP_FREE_MEM) 59 continue; 65 if (size > FRAME_SIZE) 66 size -= abase - base; 60 67 61 uintptr_t base = bootinfo->memmap[i].base; 62 size_t size = bootinfo->memmap[i].size; 63 uintptr_t abase = ALIGN_UP(base, FRAME_SIZE); 64 65 if (size > FRAME_SIZE) 66 size -= abase - base; 67 68 if (!frame_adjust_zone_bounds(low, &abase, &size)) 69 continue; 70 71 if (size > MIN_ZONE_SIZE) { 72 pfn_t pfn = ADDR2PFN(abase); 73 size_t count = SIZE2FRAMES(size); 74 75 if (low) { 76 zone_create(pfn, count, max(MINCONF, pfn), 77 ZONE_AVAILABLE | ZONE_LOWMEM); 78 } else { 79 pfn_t conf; 80 81 conf = zone_external_conf_alloc(count); 82 zone_create(pfn, count, conf, 83 ZONE_AVAILABLE | ZONE_HIGHMEM); 68 if (size > MIN_ZONE_SIZE) { 69 zone_create(abase >> FRAME_WIDTH, 70 size >> FRAME_WIDTH, 71 max(MINCONF, abase >> FRAME_WIDTH), 72 0); 73 } 74 if (abase + size > last_frame) 75 last_frame = abase + size; 84 76 } 85 77 } 86 } 87 } 78 79 /* 80 * Blacklist ROM regions. 81 */ 82 frame_mark_unavailable(ADDR2PFN(ROM_BASE), 83 SIZE2FRAMES(ROM_SIZE)); 88 84 89 void frame_low_arch_init(void) 90 { 91 if (config.cpu_active > 1) 92 return; 93 94 frame_common_arch_init(true); 95 96 /* 97 * Blacklist ROM regions. 98 */ 99 frame_mark_unavailable(ADDR2PFN(ROM_BASE), 100 SIZE2FRAMES(ROM_SIZE)); 101 102 frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), 103 SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); 104 } 105 106 void frame_high_arch_init(void) 107 { 108 if (config.cpu_active > 1) 109 return; 110 111 frame_common_arch_init(false); 85 frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), 86 SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); 87 } 112 88 } 113 89
Note:
See TracChangeset
for help on using the changeset viewer.