Changes in kernel/arch/ppc32/src/ppc32.c [eff1f033:a71c158] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/ppc32.c
reff1f033 ra71c158 39 39 #include <genarch/kbrd/kbrd.h> 40 40 #include <arch/interrupt.h> 41 #include <interrupt.h>42 41 #include <genarch/fb/fb.h> 43 42 #include <genarch/fb/visuals.h> … … 45 44 #include <genarch/ofw/pci.h> 46 45 #include <userspace.h> 47 #include <mm/page.h>48 46 #include <proc/uarg.h> 49 47 #include <console/console.h> 50 #include <sysinfo/sysinfo.h>51 48 #include <ddi/irq.h> 52 49 #include <arch/drivers/pic.h> 53 50 #include <align.h> 54 51 #include <macros.h> 55 #include <str .h>52 #include <string.h> 56 53 #include <print.h> 57 54 … … 61 58 bootinfo_t bootinfo; 62 59 63 static cir_t pic_cir;64 static void *pic_cir_arg;65 66 60 /** Performs ppc32-specific initialization before main_bsp() is called. */ 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; 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; 75 70 str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, 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; 71 bootinfo.taskmap.tasks[i].name); 85 72 } 86 73 87 74 /* Copy boot allocations info. */ 88 ballocs.base = bootinfo->ballocs.base; 89 ballocs.size = bootinfo->ballocs.size; 90 91 /* Copy OFW tree. */ 92 ofw_tree_init(bootinfo->ofw_root); 75 ballocs.base = bootinfo.ballocs.base; 76 ballocs.size = bootinfo.ballocs.size; 77 78 ofw_tree_init(bootinfo.ofw_root); 93 79 } 94 80 … … 199 185 if (assigned_address) { 200 186 /* Initialize PIC */ 201 pic_init(assigned_address[0].addr, PAGE_SIZE, &pic_cir, 202 &pic_cir_arg); 187 cir_t cir; 188 void *cir_arg; 189 pic_init(assigned_address[0].addr, PAGE_SIZE, &cir, &cir_arg); 203 190 204 191 #ifdef CONFIG_MAC_KBD … … 213 200 /* Initialize I/O controller */ 214 201 cuda_instance_t *cuda_instance = 215 cuda_init(cuda, IRQ_CUDA, pic_cir, pic_cir_arg);202 cuda_init(cuda, IRQ_CUDA, cir, cir_arg); 216 203 if (cuda_instance) { 217 204 kbrd_instance_t *kbrd_instance = kbrd_init(); … … 223 210 } 224 211 } 225 226 /*227 * This is the necessary evil until the userspace driver is entirely228 * 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);235 212 #endif 236 213 } … … 240 217 } 241 218 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 249 219 void arch_post_smp_init(void) 250 220 { 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 257 221 ofw_tree_walk_by_device_type("mac-io", macio_register, NULL); 258 222 } … … 290 254 { 291 255 // TODO 292 while ( true);256 while (1); 293 257 } 294 258
Note:
See TracChangeset
for help on using the changeset viewer.