Changeset 7978177c in mainline
- Timestamp:
- 2011-11-20T23:08:43Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25c51c8
- Parents:
- 3a4ac81b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/mm/frame.c
r3a4ac81b r7978177c 40 40 #include <print.h> 41 41 42 // XXX: remove me 42 43 uintptr_t last_frame = 0; 44 43 45 memmap_t memmap; 44 46 … … 54 56 } 55 57 56 void frame_low_arch_init(void)58 static void frame_common_arch_init(bool low) 57 59 { 58 60 pfn_t minconf = 2; … … 61 63 for (i = 0; i < memmap.cnt; i++) { 62 64 /* To be safe, make the available zone possibly smaller */ 63 uintptr_t new_start= ALIGN_UP((uintptr_t) memmap.zones[i].start,65 uintptr_t base = ALIGN_UP((uintptr_t) memmap.zones[i].start, 64 66 FRAME_SIZE); 65 size_t new_size = ALIGN_DOWN(memmap.zones[i].size -66 ( new_start- ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE);67 size_t size = ALIGN_DOWN(memmap.zones[i].size - 68 (base - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE); 67 69 68 pfn_t pfn = ADDR2PFN(new_start); 69 size_t count = SIZE2FRAMES(new_size); 70 // XXX: remove me 71 if (last_frame < ALIGN_UP(base + size, FRAME_SIZE)) 72 last_frame = ALIGN_UP(base + size, FRAME_SIZE); 70 73 74 if (!frame_adjust_zone_bounds(low, &base, &size)) 75 return; 76 77 pfn_t pfn = ADDR2PFN(base); 78 size_t count = SIZE2FRAMES(size); 71 79 pfn_t conf; 72 if ((minconf < pfn) || (minconf >= pfn + count)) 73 conf = pfn; 74 else 75 conf = minconf; 76 77 zone_create(pfn, count, conf, 0); 78 79 if (last_frame < ALIGN_UP(new_start + new_size, FRAME_SIZE)) 80 last_frame = ALIGN_UP(new_start + new_size, FRAME_SIZE); 80 81 if (low) { 82 if ((minconf < pfn) || (minconf >= pfn + count)) 83 conf = pfn; 84 else 85 conf = minconf; 86 zone_create(pfn, count, conf, 87 ZONE_AVAILABLE | ZONE_LOWMEM); 88 } else { 89 conf = zone_external_conf_alloc(count); 90 zone_create(pfn, count, conf, 91 ZONE_AVAILABLE | ZONE_HIGHMEM); 92 } 81 93 } 94 95 } 96 97 void frame_low_arch_init(void) 98 { 99 frame_common_arch_init(true); 82 100 83 101 /* First is exception vector, second is 'implementation specific', … … 94 112 void frame_high_arch_init(void) 95 113 { 114 frame_common_arch_init(false); 96 115 } 97 116
Note:
See TracChangeset
for help on using the changeset viewer.