- 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
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/include/arch.h
rbb252ca r4872160 45 45 46 46 typedef struct { 47 uintptr_taddr;48 uint32_t size;47 void *addr; 48 size_t size; 49 49 char name[BOOTINFO_TASK_NAME_BUFLEN]; 50 50 } utask_t; 51 51 52 52 typedef struct { 53 uint32_t cnt;53 size_t cnt; 54 54 utask_t tasks[TASKMAP_MAX_RECORDS]; 55 55 } bootinfo_t; -
kernel/arch/arm32/include/mm/frame.h
rbb252ca r4872160 46 46 47 47 #define BOOT_PAGE_TABLE_SIZE 0x4000 48 #define BOOT_PAGE_TABLE_ADDRESS 0x 400048 #define BOOT_PAGE_TABLE_ADDRESS 0x8000 49 49 50 50 #define BOOT_PAGE_TABLE_START_FRAME (BOOT_PAGE_TABLE_ADDRESS >> FRAME_WIDTH) -
kernel/arch/arm32/src/arm32.c
rbb252ca r4872160 62 62 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo) 63 63 { 64 unsigned int i;64 init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 65 65 66 init.cnt = bootinfo->cnt; 67 68 for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); ++i) { 69 init.tasks[i].addr = bootinfo->tasks[i].addr; 66 size_t i; 67 for (i = 0; i < init.cnt; i++) { 68 init.tasks[i].addr = (uintptr_t) bootinfo->tasks[i].addr; 70 69 init.tasks[i].size = bootinfo->tasks[i].size; 71 70 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/ia64/include/bootinfo.h
rbb252ca r4872160 32 32 #define BOOTINFO_ADDRESS 0x4401000 33 33 34 #define CONFIG_INIT_TASKS3234 #define TASKMAP_MAX_RECORDS 32 35 35 36 36 #define MEMMAP_ITEMS 128 … … 44 44 45 45 typedef struct { 46 void *addr; 47 unsigned longsize;46 void *addr; 47 size_t size; 48 48 char name[BOOTINFO_TASK_NAME_BUFLEN]; 49 49 } binit_task_t; 50 50 51 51 typedef struct { 52 unsigned long count;53 binit_task_t tasks[ CONFIG_INIT_TASKS];52 size_t cnt; 53 binit_task_t tasks[TASKMAP_MAX_RECORDS]; 54 54 } binit_t; 55 55 … … 58 58 unsigned long base; 59 59 unsigned long size; 60 }efi_memmap_item_t; 61 60 } efi_memmap_item_t; 62 61 63 62 typedef struct { 64 63 binit_t taskmap; 65 64 66 65 efi_memmap_item_t memmap[MEMMAP_ITEMS]; 67 66 unsigned int memmap_items; 68 67 69 68 unative_t *sapic; 70 69 unsigned long sys_freq; -
kernel/arch/ia64/src/ia64.c
rbb252ca r4872160 47 47 #include <mm/as.h> 48 48 #include <config.h> 49 #include <macros.h> 49 50 #include <userspace.h> 50 51 #include <console/console.h> … … 78 79 void arch_pre_main(void) 79 80 { 80 /* Setup usermode init tasks. */ 81 82 unsigned int i; 83 84 init.cnt = bootinfo->taskmap.count; 85 81 init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 82 size_t i; 86 83 for (i = 0; i < init.cnt; i++) { 87 84 init.tasks[i].addr = -
kernel/arch/mips32/include/arch.h
rbb252ca r4872160 45 45 46 46 typedef struct { 47 uintptr_taddr;47 void *addr; 48 48 size_t size; 49 49 char name[BOOTINFO_TASK_NAME_BUFLEN]; -
kernel/arch/mips32/src/mips32.c
rbb252ca r4872160 83 83 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo) 84 84 { 85 /* Setup usermode */ 86 init.cnt = bootinfo->cnt; 85 init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 87 86 88 87 size_t i; 89 for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) {90 init.tasks[i].addr = bootinfo->tasks[i].addr;88 for (i = 0; i < init.cnt; i++) { 89 init.tasks[i].addr = (uintptr_t) bootinfo->tasks[i].addr; 91 90 init.tasks[i].size = bootinfo->tasks[i].size; 92 91 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, -
kernel/arch/ppc32/include/arch.h
rbb252ca r4872160 36 36 #define KERN_ppc32_ARCH_H_ 37 37 38 extern void arch_pre_main(void); 38 #include <arch/boot/boot.h> 39 40 extern void arch_pre_main(bootinfo_t *); 39 41 40 42 #endif -
kernel/arch/ppc32/include/boot/boot.h
rbb252ca r4872160 52 52 53 53 typedef struct { 54 uintptr_taddr;55 uint32_t size;54 void *addr; 55 size_t size; 56 56 char name[BOOTINFO_TASK_NAME_BUFLEN]; 57 57 } utask_t; 58 58 59 59 typedef struct { 60 uint32_t count;60 size_t cnt; 61 61 utask_t tasks[TASKMAP_MAX_RECORDS]; 62 62 } taskmap_t; 63 63 64 64 typedef struct { 65 uintptr_tstart;66 uint32_t size;65 void *start; 66 size_t size; 67 67 } memzone_t; 68 68 69 69 typedef struct { 70 uint 32_t total;71 uint32_t count;70 uint64_t total; 71 size_t cnt; 72 72 memzone_t zones[MEMMAP_MAX_RECORDS]; 73 73 } memmap_t; … … 80 80 } bootinfo_t; 81 81 82 extern bootinfo_t bootinfo;82 extern memmap_t memmap; 83 83 84 84 #endif -
kernel/arch/ppc32/src/boot/boot.S
rbb252ca r4872160 47 47 48 48 # r3 contains physical address of bootinfo_t 49 # r4 contains size of bootinfo_t50 51 cmpwi r4, 052 beq bootinfo_end53 49 54 50 addis r3, r3, 0x8000 55 56 lis r31, bootinfo@ha57 addi r31, r31, bootinfo@l # r31 = bootinfo58 59 bootinfo_loop:60 61 lwz r30, 0(r3)62 stw r30, 0(r31)63 64 addi r3, r3, 465 addi r31, r31, 466 subi r4, r4, 467 68 cmpwi r4, 069 bgt bootinfo_loop70 71 bootinfo_end:72 73 51 bl arch_pre_main 74 52 b main_bsp -
kernel/arch/ppc32/src/mm/frame.c
rbb252ca r4872160 27 27 */ 28 28 29 /** @addtogroup ppc32mm 29 /** @addtogroup ppc32mm 30 30 * @{ 31 31 */ … … 41 41 42 42 uintptr_t last_frame = 0; 43 memmap_t memmap; 43 44 44 45 void physmem_print(void) … … 49 50 printf("---------- ----------\n"); 50 51 51 for (i = 0; i < bootinfo.memmap.count; i++) {52 printf("%#10x %#10x\n", bootinfo.memmap.zones[i].start,53 bootinfo.memmap.zones[i].size);52 for (i = 0; i < memmap.cnt; i++) { 53 printf("%#10x %#10x\n", memmap.zones[i].start, 54 memmap.zones[i].size); 54 55 } 55 56 } … … 62 63 size_t size; 63 64 64 for (i = 0; i < bootinfo.memmap.count; i++) {65 start = ADDR2PFN(ALIGN_UP( bootinfo.memmap.zones[i].start, FRAME_SIZE));66 size = SIZE2FRAMES(ALIGN_DOWN( bootinfo.memmap.zones[i].size, FRAME_SIZE));65 for (i = 0; i < memmap.cnt; i++) { 66 start = ADDR2PFN(ALIGN_UP((uintptr_t) memmap.zones[i].start, FRAME_SIZE)); 67 size = SIZE2FRAMES(ALIGN_DOWN(memmap.zones[i].size, FRAME_SIZE)); 67 68 68 69 if ((minconf < start) || (minconf >= start + size)) … … 72 73 73 74 zone_create(start, size, conf, 0); 74 if (last_frame < ALIGN_UP( bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE))75 last_frame = ALIGN_UP( bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE);75 if (last_frame < ALIGN_UP((uintptr_t) memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE)) 76 last_frame = ALIGN_UP((uintptr_t) memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE); 76 77 } 77 78 -
kernel/arch/ppc32/src/mm/page.c
rbb252ca r4872160 45 45 } 46 46 47 48 47 uintptr_t hw_map(uintptr_t physaddr, size_t size) 49 48 { -
kernel/arch/ppc32/src/ppc32.c
rbb252ca r4872160 65 65 66 66 /** Performs ppc32-specific initialization before main_bsp() is called. */ 67 void arch_pre_main(void) 68 { 69 init.cnt = bootinfo.taskmap.count; 70 71 uint32_t i; 72 73 for (i = 0; i < min3(bootinfo.taskmap.count, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { 74 init.tasks[i].addr = bootinfo.taskmap.tasks[i].addr; 75 init.tasks[i].size = bootinfo.taskmap.tasks[i].size; 67 void arch_pre_main(bootinfo_t *bootinfo) 68 { 69 /* Copy tasks map. */ 70 init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); 71 size_t i; 72 for (i = 0; i < init.cnt; i++) { 73 init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr; 74 init.tasks[i].size = bootinfo->taskmap.tasks[i].size; 76 75 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, 77 bootinfo.taskmap.tasks[i].name); 76 bootinfo->taskmap.tasks[i].name); 77 } 78 79 /* Copy physical memory map. */ 80 memmap.total = bootinfo->memmap.total; 81 memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS); 82 for (i = 0; i < memmap.cnt; i++) { 83 memmap.zones[i].start = bootinfo->memmap.zones[i].start; 84 memmap.zones[i].size = bootinfo->memmap.zones[i].size; 78 85 } 79 86 80 87 /* Copy boot allocations info. */ 81 ballocs.base = bootinfo.ballocs.base; 82 ballocs.size = bootinfo.ballocs.size; 83 84 ofw_tree_init(bootinfo.ofw_root); 88 ballocs.base = bootinfo->ballocs.base; 89 ballocs.size = bootinfo->ballocs.size; 90 91 /* Copy OFW tree. */ 92 ofw_tree_init(bootinfo->ofw_root); 85 93 } 86 94 -
kernel/arch/sparc64/include/arch.h
rbb252ca r4872160 27 27 */ 28 28 29 /** @addtogroup sparc64 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ 32 32 /** 33 33 * @file 34 * @brief 34 * @brief Various sparc64-specific macros. 35 35 */ 36 36 37 37 #ifndef KERN_sparc64_ARCH_H_ 38 38 #define KERN_sparc64_ARCH_H_ 39 40 #include <arch/boot/boot.h> 39 41 40 42 #if defined (SUN4U) … … 44 46 #endif 45 47 46 #define ASI_AIUP 0x10/** Access to primary context with user privileges. */47 #define ASI_AIUS 0x11/** Access to secondary context with user privileges. */48 #define ASI_AIUP 0x10 /** Access to primary context with user privileges. */ 49 #define ASI_AIUS 0x11 /** Access to secondary context with user privileges. */ 48 50 49 #define NWINDOWS 8/** Number of register window sets. */51 #define NWINDOWS 8 /** Number of register window sets. */ 50 52 51 53 #ifndef __ASM__ 52 54 53 extern void arch_pre_main( void);55 extern void arch_pre_main(bootinfo_t *); 54 56 55 57 #endif /* __ASM__ */ 56 57 58 58 59 #endif -
kernel/arch/sparc64/include/boot/boot.h
rbb252ca r4872160 27 27 */ 28 28 29 /** @addtogroup sparc64 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 36 36 #define KERN_sparc64_BOOT_H_ 37 37 38 #define VMA 39 #define LMA 38 #define VMA 0x400000 39 #define LMA VMA 40 40 41 41 #ifndef __ASM__ … … 46 46 #include <genarch/ofw/ofw_tree.h> 47 47 48 #define TASKMAP_MAX_RECORDS 49 #define MEMMAP_MAX_RECORDS 48 #define TASKMAP_MAX_RECORDS 32 49 #define MEMMAP_MAX_RECORDS 32 50 50 51 #define BOOTINFO_TASK_NAME_BUFLEN 3251 #define BOOTINFO_TASK_NAME_BUFLEN 32 52 52 53 53 typedef struct { 54 void * 55 uint32_t size;54 void *addr; 55 size_t size; 56 56 char name[BOOTINFO_TASK_NAME_BUFLEN]; 57 57 } utask_t; 58 58 59 59 typedef struct { 60 uint32_t count;60 size_t cnt; 61 61 utask_t tasks[TASKMAP_MAX_RECORDS]; 62 62 } taskmap_t; 63 63 64 64 typedef struct { 65 uintptr_tstart;66 uint32_t size;65 void *start; 66 size_t size; 67 67 } memzone_t; 68 68 69 69 typedef struct { 70 uint 32_t total;71 uint32_t count;70 uint64_t total; 71 size_t cnt; 72 72 memzone_t zones[MEMMAP_MAX_RECORDS]; 73 73 } memmap_t; … … 76 76 * 77 77 * Must be in sync with bootinfo structure used by the boot loader. 78 * 78 79 */ 79 80 typedef struct { … … 85 86 } bootinfo_t; 86 87 87 extern bootinfo_t bootinfo; 88 extern memmap_t memmap; 89 extern uintptr_t physmem_start; 88 90 89 91 #endif -
kernel/arch/sparc64/src/mm/sun4u/frame.c
rbb252ca r4872160 43 43 uintptr_t last_frame = NULL; 44 44 45 /** Create memory zones according to information stored in bootinfo.45 /** Create memory zones according to information stored in memmap. 46 46 * 47 * Walk the bootinfomemory map and create frame zones according to it.47 * Walk the memory map and create frame zones according to it. 48 48 */ 49 49 void frame_arch_init(void) … … 53 53 54 54 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;55 for (i = 0; i < memmap.cnt; i++) { 56 uintptr_t start = (uintptr_t) memmap.zones[i].start; 57 size_t size = memmap.zones[i].size; 58 58 59 59 /* -
kernel/arch/sparc64/src/mm/sun4v/frame.c
rbb252ca r4872160 41 41 #include <macros.h> 42 42 43 /** Create memory zones according to information stored in bootinfo.43 /** Create memory zones according to information stored in memmap. 44 44 * 45 * Walk the bootinfomemory map and create frame zones according to it.45 * Walk the memory map and create frame zones according to it. 46 46 */ 47 47 void frame_arch_init(void) … … 51 51 52 52 if (config.cpu_active == 1) { 53 for (i = 0; i < bootinfo.memmap.count; i++) {54 uintptr_t start = bootinfo.memmap.zones[i].start;55 size_t size = bootinfo.memmap.zones[i].size;53 for (i = 0; i < memmap->count; i++) { 54 uintptr_t start = (uintptr_t) memmap.zones[i].start; 55 size_t size = memmap.zones[i].size; 56 56 57 57 /* -
kernel/arch/sparc64/src/smp/sun4v/smp.c
rbb252ca r4872160 417 417 static bool wake_cpu(uint64_t cpuid) 418 418 { 419 420 419 #ifdef CONFIG_SIMICS_SMP_HACK 421 420 ipi_unicast_to((void (*)(void)) 1234, cpuid); … … 424 423 if (__hypercall_fast1(CPU_STOP, cpuid) != EOK) 425 424 return false; 426 425 427 426 /* wait for the CPU to stop */ 428 427 uint64_t state; 429 __hypercall_fast_ret1(cpuid, 0, 0, 0, 0, 430 CPU_STATE, &state); 431 while (state == CPU_STATE_RUNNING) { 432 __hypercall_fast_ret1(cpuid, 0, 0, 0, 0, 433 CPU_STATE, &state); 434 } 435 428 __hypercall_fast_ret1(cpuid, 0, 0, 0, 0, CPU_STATE, &state); 429 while (state == CPU_STATE_RUNNING) 430 __hypercall_fast_ret1(cpuid, 0, 0, 0, 0, CPU_STATE, &state); 431 436 432 /* make the CPU run again and execute HelenOS code */ 437 if (__hypercall_fast4( 438 CPU_START, cpuid, 439 (uint64_t) KA2PA(kernel_image_start), 440 KA2PA(trap_table), bootinfo.physmem_start 441 ) != EOK) 442 return false; 433 if (__hypercall_fast4(CPU_START, cpuid, 434 (uint64_t) KA2PA(kernel_image_start), KA2PA(trap_table), 435 physmem_start) != EOK) 436 return false; 443 437 #endif 444 438 445 439 if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) == 446 447 printf("%s: waiting for processor (cpuid = %" PRIu32 448 ") timed out\n",__func__, cpuid);449 440 ESYNCH_TIMEOUT) 441 printf("%s: waiting for processor (cpuid = %" PRIu32 ") timed out\n", 442 __func__, cpuid); 443 450 444 return true; 451 445 } -
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 -
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 -
kernel/genarch/include/ofw/ofw_tree.h
rbb252ca r4872160 34 34 #define OFW_TREE_PROPERTY_MAX_NAMELEN 32 35 35 36 typedef uint32_t phandle; 37 36 38 /** Memory representation of OpenFirmware device tree node property. */ 37 39 typedef struct { … … 47 49 struct ofw_tree_node *child; 48 50 49 uint32_t node_handle;/**< Old OpenFirmware node handle. */51 phandle node_handle; /**< Old OpenFirmware node handle. */ 50 52 51 53 char *da_name; /**< Disambigued name. */ 52 54 53 unsigned int properties;/**< Number of properties. */55 size_t properties; /**< Number of properties. */ 54 56 ofw_tree_property_t *property; 55 57 … … 83 85 const char *); 84 86 extern ofw_tree_node_t *ofw_tree_find_node_by_handle(ofw_tree_node_t *, 85 uint32_t);87 phandle); 86 88 87 89 #endif -
kernel/genarch/src/ofw/ofw_tree.c
rbb252ca r4872160 65 65 const char *name) 66 66 { 67 unsigned int i;67 size_t i; 68 68 69 69 for (i = 0; i < node->properties; i++) { … … 170 170 */ 171 171 ofw_tree_node_t *ofw_tree_find_node_by_handle(ofw_tree_node_t *root, 172 uint32_thandle)172 phandle handle) 173 173 { 174 174 ofw_tree_node_t *cur;
Note:
See TracChangeset
for help on using the changeset viewer.