Changeset 95b47c82 in mainline for boot/arch/sparc64/loader/main.c
- Timestamp:
- 2007-04-15T20:51:04Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a7a970
- Parents:
- ddee708
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/main.c
rddee708 r95b47c82 93 93 for (i = 0; i < COMPONENTS; i++) 94 94 printf(" %P: %s image (size %d bytes)\n", components[i].start, 95 95 components[i].name, components[i].size); 96 96 97 97 void * base = (void *) KERNEL_VIRTUAL_ADDRESS; … … 103 103 printf(" %s...", components[i].name); 104 104 top = ALIGN_UP(top, PAGE_SIZE); 105 106 /* 107 * At this point, we claim the physical memory that we are 108 * going to use. We should be safe in case of the virtual 109 * address space because the OpenFirmware, according to its 110 * SPARC binding, should restrict its use of virtual memory 111 * to addresses from [0xffd00000; 0xffefffff] and 112 * [0xfe000000; 0xfeffffff]. 113 */ 114 (void) ofw_claim_phys(bootinfo.physmem_start + base + top, 115 ALIGN_UP(components[i].size, PAGE_SIZE)); 116 105 117 memcpy(base + top, components[i].start, components[i].size); 106 118 if (i > 0) { 107 bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = base + top; 108 bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = components[i].size; 119 bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = 120 base + top; 121 bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = 122 components[i].size; 109 123 bootinfo.taskmap.count++; 110 124 } … … 113 127 } 114 128 115 balloc_init(&bootinfo.ballocs, ALIGN_UP(((uintptr_t) base) + top, PAGE_SIZE)); 129 /* 130 * Claim the physical memory for the boot allocator. 131 * Initialize the boot allocator. 132 */ 133 (void) ofw_claim_phys(bootinfo.physmem_start + 134 base + ALIGN_UP(top, PAGE_SIZE), BALLOC_MAX_SIZE); 135 balloc_init(&bootinfo.ballocs, ALIGN_UP(((uintptr_t) base) + top, 136 PAGE_SIZE)); 116 137 117 138 printf("\nCanonizing OpenFirmware device tree..."); … … 128 149 printf("\nBooting the kernel...\n"); 129 150 jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, 130 bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, sizeof(bootinfo)); 151 bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, 152 sizeof(bootinfo)); 131 153 } 154
Note:
See TracChangeset
for help on using the changeset viewer.