Changeset 4872160 in mainline for kernel/arch/sparc64/src/sun4u
- Timestamp:
- 2010-05-04T10:44:55Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 568db0f
- Parents:
- bb252ca
- Location:
- kernel/arch/sparc64/src/sun4u
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/sun4u/sparc64.c
rbb252ca r4872160 36 36 #include <debug.h> 37 37 #include <config.h> 38 #include <macros.h> 38 39 #include <arch/trap/trap.h> 39 40 #include <arch/console.h> … … 50 51 #include <str.h> 51 52 52 bootinfo_t bootinfo;53 memmap_t memmap; 53 54 54 55 /** Perform sparc64-specific initialization before main_bsp() is called. */ 55 void arch_pre_main( void)56 void arch_pre_main(bootinfo_t *bootinfo) 56 57 { 57 58 /* Copy init task info. */ 58 init.cnt = bootinfo.taskmap.count;59 init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 59 60 60 uint32_t i; 61 62 for (i = 0; i < bootinfo.taskmap.count; i++) { 63 init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr; 64 init.tasks[i].size = bootinfo.taskmap.tasks[i].size; 61 size_t i; 62 for (i = 0; i < init.cnt; i++) { 63 init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr; 64 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 65 65 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, 66 bootinfo.taskmap.tasks[i].name); 66 bootinfo->taskmap.tasks[i].name); 67 } 68 69 /* Copy physical memory map. */ 70 memmap.total = bootinfo->memmap.total; 71 memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS); 72 for (i = 0; i < memmap.cnt; i++) { 73 memmap.zones[i].start = bootinfo->memmap.zones[i].start; 74 memmap.zones[i].size = bootinfo->memmap.zones[i].size; 67 75 } 68 76 69 77 /* Copy boot allocations info. */ 70 ballocs.base = bootinfo .ballocs.base;71 ballocs.size = bootinfo .ballocs.size;78 ballocs.base = bootinfo->ballocs.base; 79 ballocs.size = bootinfo->ballocs.size; 72 80 73 ofw_tree_init(bootinfo .ofw_root);81 ofw_tree_init(bootinfo->ofw_root); 74 82 } 75 83 -
kernel/arch/sparc64/src/sun4u/start.S
rbb252ca r4872160 60 60 /* 61 61 * Here is where the kernel is passed control from the boot loader. 62 * 62 * 63 63 * The registers are expected to be in this state: 64 * - %o0 starting address of physical memory + bootstrap processor flag65 * bits 63...1: physical memory starting address / 266 * bit 0: non-zero on BSP processor, zero on AP processors67 * - %o1 bootinfo structure address (BSP only)68 * - %o2 bootinfo structure size (BSP only)64 * - %o0 bootinfo structure address (BSP only) 65 * - %o1 starting address of physical memory 66 * + bootstrap processor flag 67 * bits 63...1: physical memory starting address / 2 68 * bit 0: non-zero on BSP processor, zero on AP processors 69 69 * 70 70 * Moreover, we depend on boot having established the following environment: 71 * - TLBs are on 72 * - identity mapping for the kernel image 71 * - TLBs are on 72 * - identity mapping for the kernel image 73 * 73 74 */ 74 75 … … 76 77 kernel_image_start: 77 78 mov BSP_FLAG, %l0 78 and %o 0, %l0, %l7 ! l7 <= bootstrap processor?79 andn %o 0, %l0, %l6 ! l6 <= start of physical memory79 and %o1, %l0, %l7 ! l7 <= bootstrap processor? 80 andn %o1, %l0, %l6 ! l6 <= start of physical memory 80 81 81 82 ! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base. … … 282 283 sub %sp, STACK_BIAS, %sp 283 284 284 sethi %hi(bootinfo), %o0285 call memcpy ! copy bootinfo286 or %o0, %lo(bootinfo), %o0287 288 285 call arch_pre_main 289 286 nop
Note:
See TracChangeset
for help on using the changeset viewer.
