Changeset 4872160 in mainline for kernel/arch/sparc64/src/sun4v
- Timestamp:
- 2010-05-04T10:44:55Z (15 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/sun4v
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/sun4v/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> … … 52 53 #include <arch/drivers/niagara.h> 53 54 54 bootinfo_t bootinfo;55 memmap_t memmap; 55 56 56 57 /** Perform sparc64-specific initialization before main_bsp() is called. */ 57 void arch_pre_main( void)58 void arch_pre_main(bootinfo_t *bootinfo) 58 59 { 59 60 /* Copy init task info. */ 60 init.cnt = bootinfo.taskmap.count;61 init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 61 62 62 uint32_t i; 63 64 for (i = 0; i < bootinfo.taskmap.count; i++) { 65 init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr; 66 init.tasks[i].size = bootinfo.taskmap.tasks[i].size; 63 size_t i; 64 for (i = 0; i < init.cnt; i++) { 65 init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr; 66 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 67 67 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, 68 bootinfo .taskmap.tasks[i].name);68 bootinfo->taskmap.tasks[i].name); 69 69 } 70 70 71 /* Copy physical memory map. */ 72 memmap.total = bootinfo->memmap.total; 73 memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS); 74 for (i = 0; i < memmap.cnt; i++) { 75 memmap.zones[i].start = bootinfo->memmap.zones[i].start; 76 memmap.zones[i].size = bootinfo->memmap.zones[i].size; 77 } 78 71 79 md_init(); 72 80 } -
kernel/arch/sparc64/src/sun4v/start.S
rbb252ca r4872160 75 75 * 76 76 * parameters: 77 * addr: virtual address to be mapped 78 * rphysmem_start: register containing the starting address of the 79 * physical memory 80 * rtmp1: a register to be used as temporary 81 * rtmp2: a register to be used as temporary 82 * rd: register where the result will be saved 77 * addr: virtual address to be mapped 78 * rphysmem_start: register containing the starting address 79 * of the physical memory 80 * rtmp1: a register to be used as temporary 81 * rtmp2: a register to be used as temporary 82 * rd: register where the result will be saved 83 * 83 84 */ 84 85 #define TTE_DATA(addr, rphysmem_start, rtmp1, rtmp2, rd) \ … … 90 91 /* 91 92 * Here is where the kernel is passed control from the boot loader. 92 * 93 * 93 94 * The registers are expected to be in this state: 94 * - %o0 starting address of physical memory + bootstrap processor flag95 * bits 63...1: physical memory starting address / 296 * bit 0: non-zero on BSP processor, zero on AP processors97 * - %o1 bootinfo structure address (BSP only)98 * - %o2 bootinfo structure size (BSP only)95 * - %o0 bootinfo structure address (BSP only) 96 * - %o1 starting address of physical memory 97 * + bootstrap processor flag 98 * bits 63...1: physical memory starting address / 2 99 * bit 0: non-zero on BSP processor, zero on AP processors 99 100 * 100 101 * Moreover, we depend on boot having established the following environment: 101 * - TLBs are on 102 * - identity mapping for the kernel image 102 * - TLBs are on 103 * - identity mapping for the kernel image 104 * 103 105 */ 104 106 .global kernel_image_start 105 107 kernel_image_start: 106 108 mov BSP_FLAG, %l0 107 and %o0, %l0, %l7 ! l7 <= bootstrap processor? 108 andn %o0, %l0, %l6 ! l6 <= start of physical memory 109 or %o1, %g0, %l1 110 or %o2, %g0, %l2 109 and %o1, %l0, %l7 ! l7 <= bootstrap processor? 110 andn %o1, %l0, %l6 ! l6 <= start of physical memory 111 or %o0, %g0, %l0 111 112 112 113 ! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base. … … 245 246 sub %sp, STACK_BIAS, %sp 246 247 247 or %l1, %g0, %o1 248 or %l2, %g0, %o2 249 sethi %hi(bootinfo), %o0 250 call memcpy ! copy bootinfo 251 or %o0, %lo(bootinfo), %o0 252 248 or %l0, %g0, %o0 253 249 call arch_pre_main 254 250 nop
Note:
See TracChangeset
for help on using the changeset viewer.
