Changeset 4872160 in mainline for kernel/arch/ppc32
- 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/ppc32
- Files:
-
- 6 edited
-
include/arch.h (modified) (1 diff)
-
include/boot/boot.h (modified) (2 diffs)
-
src/boot/boot.S (modified) (1 diff)
-
src/mm/frame.c (modified) (5 diffs)
-
src/mm/page.c (modified) (1 diff)
-
src/ppc32.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
