Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/ppc32.c

    reff1f033 ra71c158  
    3939#include <genarch/kbrd/kbrd.h>
    4040#include <arch/interrupt.h>
    41 #include <interrupt.h>
    4241#include <genarch/fb/fb.h>
    4342#include <genarch/fb/visuals.h>
     
    4544#include <genarch/ofw/pci.h>
    4645#include <userspace.h>
    47 #include <mm/page.h>
    4846#include <proc/uarg.h>
    4947#include <console/console.h>
    50 #include <sysinfo/sysinfo.h>
    5148#include <ddi/irq.h>
    5249#include <arch/drivers/pic.h>
    5350#include <align.h>
    5451#include <macros.h>
    55 #include <str.h>
     52#include <string.h>
    5653#include <print.h>
    5754
     
    6158bootinfo_t bootinfo;
    6259
    63 static cir_t pic_cir;
    64 static void *pic_cir_arg;
    65 
    6660/** 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;
     61void 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;
    7570                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);
    8572        }
    8673       
    8774        /* 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);
    9379}
    9480
     
    199185        if (assigned_address) {
    200186                /* 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);
    203190               
    204191#ifdef CONFIG_MAC_KBD
     
    213200                /* Initialize I/O controller */
    214201                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);
    216203                if (cuda_instance) {
    217204                        kbrd_instance_t *kbrd_instance = kbrd_init();
     
    223210                        }
    224211                }
    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);
    235212#endif
    236213        }
     
    240217}
    241218
    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 
    249219void arch_post_smp_init(void)
    250220{
    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 
    257221        ofw_tree_walk_by_device_type("mac-io", macio_register, NULL);
    258222}
     
    290254{
    291255        // TODO
    292         while (true);
     256        while (1);
    293257}
    294258
Note: See TracChangeset for help on using the changeset viewer.