Changeset 46c20c8 in mainline for kernel/arch/sparc64/src/mm/sun4v/frame.c
- Timestamp:
- 2010-11-26T20:08:10Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45df59a
- Parents:
- fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
kernel/arch/sparc64/src/mm/sun4v/frame.c (moved) (moved from kernel/arch/sparc64/src/mm/frame.c ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/sun4v/frame.c
rfb150d78 r46c20c8 36 36 #include <mm/frame.h> 37 37 #include <arch/boot/boot.h> 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <config.h> 40 40 #include <align.h> 41 41 #include <macros.h> 42 42 43 uintptr_t last_frame = NULL; 44 45 /** Create memory zones according to information stored in bootinfo. 43 /** Create memory zones according to information stored in memmap. 46 44 * 47 * Walk the bootinfomemory map and create frame zones according to it.45 * Walk the memory map and create frame zones according to it. 48 46 */ 49 47 void frame_arch_init(void) 50 48 { 51 unsigned int i;52 pfn_t confdata;53 54 49 if (config.cpu_active == 1) { 55 for (i = 0; i < bootinfo.memmap.count; i++) { 56 uintptr_t start = bootinfo.memmap.zones[i].start; 57 size_t size = bootinfo.memmap.zones[i].size; 58 50 unsigned int i; 51 52 for (i = 0; i < memmap.cnt; i++) { 53 /* To be safe, make the available zone possibly smaller */ 54 uintptr_t new_start = ALIGN_UP((uintptr_t) memmap.zones[i].start, 55 FRAME_SIZE); 56 size_t new_size = ALIGN_DOWN(memmap.zones[i].size - 57 (new_start - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE); 58 59 59 /* 60 60 * The memmap is created by HelenOS boot loader. 61 61 * It already contains no holes. 62 62 */ 63 64 confdata = ADDR2PFN(start); 63 64 pfn_t confdata = ADDR2PFN(new_start); 65 65 66 if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0)))) 66 67 confdata = ADDR2PFN(KA2PA(PFN2ADDR(2))); 67 zone_create(ADDR2PFN(start),68 SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)),68 69 zone_create(ADDR2PFN(new_start), SIZE2FRAMES(new_size), 69 70 confdata, 0); 70 last_frame = max(last_frame, start + ALIGN_UP(size,71 FRAME_SIZE));72 71 } 73 72 74 73 /* 75 74 * On sparc64, physical memory can start on a non-zero address. … … 80 79 frame_mark_unavailable(ADDR2PFN(KA2PA(PFN2ADDR(0))), 1); 81 80 } 82 83 end_of_identity = PA2KA(last_frame);84 81 } 85 82
Note:
See TracChangeset
for help on using the changeset viewer.
