Changeset 94d614e in mainline for kernel/arch/sparc64/src/mm
- Timestamp:
- 2006-07-13T17:32:38Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5f76758
- Parents:
- 63cda71
- Location:
- kernel/arch/sparc64/src/mm
- Files:
-
- 2 edited
-
frame.c (modified) (1 diff)
-
memory_init.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/frame.c
r63cda71 r94d614e 34 34 35 35 #include <arch/mm/frame.h> 36 #include <genarch/ofw/memory_init.h>37 36 #include <mm/frame.h> 37 #include <arch/boot/boot.h> 38 38 #include <config.h> 39 39 #include <align.h> 40 40 41 /** Create memory zones according to information stored in bootinfo. 42 * 43 * Walk the bootinfo memory map and create frame zones according to it. 44 * The first frame is not blacklisted here as it is done in generic 45 * frame_init(). 46 */ 41 47 void frame_arch_init(void) 42 48 { 43 ofw_init_zones(); 49 int i; 50 pfn_t confdata; 44 51 45 /* 46 * Workaround to prevent slab allocator from allocating frame 0. 47 * Frame 0 is 48 * a) not mapped by OFW 49 * b) would be confused with NULL error return code 50 */ 51 frame_mark_unavailable(0, 1); 52 for (i = 0; i < bootinfo.memmap.count; i++) { 53 54 /* 55 * The memmap is created by HelenOS boot loader. 56 * It already contains no holes. 57 */ 58 59 confdata = ADDR2PFN(bootinfo.memmap.zones[i].start); 60 if (confdata == 0) 61 confdata = 2; 62 zone_create(ADDR2PFN(bootinfo.memmap.zones[i].start), 63 SIZE2FRAMES(ALIGN_DOWN(bootinfo.memmap.zones[i].size, PAGE_SIZE)), 64 confdata, 0); 65 } 66 52 67 } 53 68 -
kernel/arch/sparc64/src/mm/memory_init.c
r63cda71 r94d614e 34 34 35 35 #include <arch/mm/memory_init.h> 36 #include < genarch/ofw/memory_init.h>36 #include <arch/boot/boot.h> 37 37 #include <typedefs.h> 38 38 39 /** Return total size of available memory in bytes. 40 * 41 * @return Size of available memory in bytes. 42 */ 39 43 size_t get_memory_size(void) 40 44 { 41 return ofw_get_memory_size();45 return bootinfo.memmap.total; 42 46 } 43 47 44 48 /** @} 45 49 */ 46
Note:
See TracChangeset
for help on using the changeset viewer.
