Changeset c6f1908e in mainline
- Timestamp:
- 2011-11-15T00:08:46Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 19c8030
- Parents:
- 8bdcffa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/mm/frame.c
r8bdcffa rc6f1908e 41 41 #include <macros.h> 42 42 43 // TODO: remove me 43 44 /** Address of the last frame in the memory. */ 44 45 uintptr_t last_frame = 0; 45 46 46 /** Create smemory zones. */47 /** Create low memory zones. */ 47 48 void frame_low_arch_init(void) 48 49 { 49 uintptr_t mem_start, mem_size; 50 uintptr_t first_frame; 51 uintptr_t num_frames; 50 uintptr_t mem_start, mem_end, mem_size; 52 51 53 52 machine_get_memory_extents(&mem_start, &mem_size); 54 first_frame = ALIGN_UP(mem_start, FRAME_SIZE);53 // TODO: remove me 55 54 last_frame = ALIGN_DOWN(mem_start + mem_size, FRAME_SIZE); 56 num_frames = (last_frame - first_frame) >> FRAME_WIDTH;57 55 58 /* All memory as one zone */ 59 zone_create(first_frame >> FRAME_WIDTH, num_frames, 60 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0); 56 mem_start = ALIGN_UP(mem_start, FRAME_SIZE); 57 mem_end = min(ALIGN_DOWN(mem_start + mem_size, FRAME_SIZE), 58 config.identity_size); 59 60 zone_create(ADDR2PFN(mem_start), SIZE2FRAMES(mem_end - mem_start), 61 BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 62 ZONE_AVAILABLE | ZONE_LOWMEM); 61 63 62 64 /* blacklist boot page table */ … … 67 69 } 68 70 71 /** Create high memory zones. */ 69 72 void frame_high_arch_init(void) 70 73 { 74 uintptr_t mem_start, mem_end, mem_size; 75 size_t frames; 76 uintptr_t conf; 77 78 machine_get_memory_extents(&mem_start, &mem_size); 79 80 mem_end = ALIGN_DOWN(mem_start + mem_size, FRAME_SIZE); 81 if (mem_end <= config.identity_size) { 82 /* There is no high memory to init. */ 83 return; 84 } 85 86 frames = SIZE2FRAMES(mem_end - config.identity_size); 87 conf = zone_external_conf_alloc(frames); 88 89 zone_create(ADDR2PFN(config.identity_size), frames, conf, 90 ZONE_AVAILABLE); 71 91 } 72 92
Note:
See TracChangeset
for help on using the changeset viewer.