Changeset 25c51c8 in mainline
- Timestamp:
- 2011-11-21T22:40:36Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50177dcd
- Parents:
- 7978177c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/mm/frame.c
r7978177c r25c51c8 51 51 #define MINCONF 1 52 52 53 // XXX: remove me 53 54 uintptr_t last_frame = 0; 55 56 static void frame_common_arch_init(bool low) 57 { 58 unsigned int i; 59 60 for (i = 0; i < bootinfo->memmap_items; i++) { 61 if (bootinfo->memmap[i].type != MEMMAP_FREE_MEM) 62 continue; 63 64 uintptr_t base = bootinfo->memmap[i].base; 65 size_t size = bootinfo->memmap[i].size; 66 uintptr_t abase = ALIGN_UP(base, FRAME_SIZE); 67 68 if (size > FRAME_SIZE) 69 size -= abase - base; 70 71 // FIXME: remove me 72 if (abase + size > last_frame) 73 last_frame = abase + size; 74 75 if (!frame_adjust_zone_bounds(low, &abase, &size)) 76 continue; 77 78 if (size > MIN_ZONE_SIZE) { 79 pfn_t pfn = ADDR2PFN(abase); 80 size_t count = SIZE2FRAMES(size); 81 82 if (low) { 83 zone_create(pfn, count, max(MINCONF, pfn), 84 ZONE_AVAILABLE | ZONE_LOWMEM); 85 } else { 86 pfn_t conf; 87 88 conf = zone_external_conf_alloc(count); 89 zone_create(pfn, count, conf, 90 ZONE_AVAILABLE | ZONE_HIGHMEM); 91 } 92 } 93 } 94 } 54 95 55 96 void frame_low_arch_init(void) 56 97 { 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); 98 if (config.cpu_active > 1) 99 return; 100 101 frame_common_arch_init(true); 102 103 /* 104 * Blacklist ROM regions. 105 */ 106 frame_mark_unavailable(ADDR2PFN(ROM_BASE), 107 SIZE2FRAMES(ROM_SIZE)); 64 108 65 if (size > FRAME_SIZE) 66 size -= abase - base; 67 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; 76 } 77 } 78 79 /* 80 * Blacklist ROM regions. 81 */ 82 frame_mark_unavailable(ADDR2PFN(ROM_BASE), 83 SIZE2FRAMES(ROM_SIZE)); 84 85 frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), 86 SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); 87 } 109 frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), 110 SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); 88 111 } 89 112 90 113 void frame_high_arch_init(void) 91 114 { 115 if (config.cpu_active > 1) 116 return; 117 118 frame_common_arch_init(false); 92 119 } 93 120
Note:
See TracChangeset
for help on using the changeset viewer.