Changes in kernel/arch/ppc32/src/ppc32.c [a71c158:eff1f033] in mainline
- File:
-
- 1 edited
-
kernel/arch/ppc32/src/ppc32.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/ppc32.c
ra71c158 reff1f033 39 39 #include <genarch/kbrd/kbrd.h> 40 40 #include <arch/interrupt.h> 41 #include <interrupt.h> 41 42 #include <genarch/fb/fb.h> 42 43 #include <genarch/fb/visuals.h> … … 44 45 #include <genarch/ofw/pci.h> 45 46 #include <userspace.h> 47 #include <mm/page.h> 46 48 #include <proc/uarg.h> 47 49 #include <console/console.h> 50 #include <sysinfo/sysinfo.h> 48 51 #include <ddi/irq.h> 49 52 #include <arch/drivers/pic.h> 50 53 #include <align.h> 51 54 #include <macros.h> 52 #include <str ing.h>55 #include <str.h> 53 56 #include <print.h> 54 57 … … 58 61 bootinfo_t bootinfo; 59 62 63 static cir_t pic_cir; 64 static void *pic_cir_arg; 65 60 66 /** Performs ppc32-specific initialization before main_bsp() is called. */ 61 void arch_pre_main(void) 62 { 63 init.cnt = bootinfo.taskmap.count; 64 65 uint32_t i; 66 67 for (i = 0; i < min3(bootinfo.taskmap.count, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { 68 init.tasks[i].addr = bootinfo.taskmap.tasks[i].addr; 69 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; 70 75 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, 71 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; 72 85 } 73 86 74 87 /* Copy boot allocations info. */ 75 ballocs.base = bootinfo.ballocs.base; 76 ballocs.size = bootinfo.ballocs.size; 77 78 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); 79 93 } 80 94 … … 185 199 if (assigned_address) { 186 200 /* Initialize PIC */ 187 cir_t cir; 188 void *cir_arg; 189 pic_init(assigned_address[0].addr, PAGE_SIZE, &cir, &cir_arg); 201 pic_init(assigned_address[0].addr, PAGE_SIZE, &pic_cir, 202 &pic_cir_arg); 190 203 191 204 #ifdef CONFIG_MAC_KBD … … 200 213 /* Initialize I/O controller */ 201 214 cuda_instance_t *cuda_instance = 202 cuda_init(cuda, IRQ_CUDA, cir,cir_arg);215 cuda_init(cuda, IRQ_CUDA, pic_cir, pic_cir_arg); 203 216 if (cuda_instance) { 204 217 kbrd_instance_t *kbrd_instance = kbrd_init(); … … 210 223 } 211 224 } 225 226 /* 227 * This is the necessary evil until the userspace driver is entirely 228 * self-sufficient. 229 */ 230 sysinfo_set_item_val("cuda", NULL, true); 231 sysinfo_set_item_val("cuda.inr", NULL, IRQ_CUDA); 232 sysinfo_set_item_val("cuda.address.physical", NULL, pa); 233 sysinfo_set_item_val("cuda.address.kernel", NULL, 234 (uintptr_t) cuda); 212 235 #endif 213 236 } … … 217 240 } 218 241 242 void irq_initialize_arch(irq_t *irq) 243 { 244 irq->cir = pic_cir; 245 irq->cir_arg = pic_cir_arg; 246 irq->preack = true; 247 } 248 219 249 void arch_post_smp_init(void) 220 250 { 251 /* Currently the only supported platform for ppc32 is 'mac'. */ 252 static const char *platform = "mac"; 253 254 sysinfo_set_item_data("platform", NULL, (void *) platform, 255 str_size(platform)); 256 221 257 ofw_tree_walk_by_device_type("mac-io", macio_register, NULL); 222 258 } … … 254 290 { 255 291 // TODO 256 while ( 1);292 while (true); 257 293 } 258 294
Note:
See TracChangeset
for help on using the changeset viewer.
