Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/src/main.c

    r4646710 ra35b458  
    8686        phandle root = ofw_find_device("/");
    8787        char compatible[OFW_TREE_PROPERTY_MAX_VALUELEN];
    88        
     88
    8989        if (ofw_get_property(root, "compatible", compatible,
    9090            OFW_TREE_PROPERTY_MAX_VALUELEN) <= 0) {
     
    9393                return;
    9494        }
    95        
     95
    9696        if (str_cmp(compatible, "sun4v") != 0) {
    9797                /*
     
    122122                : [ver] "=r" (ver)
    123123        );
    124        
     124
    125125        ver = (ver << 16) >> 48;
    126        
     126
    127127        if ((ver >= FIRST_US3_CPU) && (ver <= LAST_US3_CPU)) {
    128128                subarch = SUBARCH_US3;
    129                
     129
    130130                if (ver == US_IIIi_CODE)
    131131                        mid_mask = (1 << 5) - 1;
    132132                else
    133133                        mid_mask = (1 << 10) - 1;
    134                
     134
    135135        } else if (ver < FIRST_US3_CPU) {
    136136                subarch = SUBARCH_US;
     
    193193{
    194194        version_print();
    195        
     195
    196196        arch_detect();
    197197        if (arch == ARCH_SUN4U)
     
    199199        else
    200200                subarch = SUBARCH_UNKNOWN;
    201        
     201
    202202        bootinfo.physmem_start = ofw_get_physmem_start();
    203203        ofw_memmap(&bootinfo.memmap);
     
    205205        if (arch == ARCH_SUN4V)
    206206                sun4v_fixups();
    207        
     207
    208208        void *bootinfo_pa = ofw_translate(&bootinfo);
    209209        void *kernel_address_pa = ofw_translate((void *) KERNEL_ADDRESS);
    210210        void *loader_address_pa = ofw_translate((void *) LOADER_ADDRESS);
    211        
     211
    212212        printf("\nMemory statistics (total %" PRIu64 " MB, starting at %p)\n",
    213213            bootinfo.memmap.total >> 20, (void *) bootinfo.physmem_start);
     
    217217        printf(" %p|%p: loader entry point\n",
    218218            (void *) LOADER_ADDRESS, (void *) loader_address_pa);
    219        
     219
    220220        size_t i;
    221221        for (i = 0; i < COMPONENTS; i++)
     
    223223                    ofw_translate(components[i].addr), components[i].name,
    224224                    components[i].inflated, components[i].size);
    225        
     225
    226226        void *dest[COMPONENTS];
    227227        size_t top = KERNEL_ADDRESS;
     
    230230        for (i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
    231231                top = ALIGN_UP(top, PAGE_SIZE);
    232                
     232
    233233                if (i > 0) {
    234234                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].addr =
     
    236236                        bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].size =
    237237                            components[i].inflated;
    238                        
     238
    239239                        str_cpy(bootinfo.taskmap.tasks[bootinfo.taskmap.cnt].name,
    240240                            BOOTINFO_TASK_NAME_BUFLEN, components[i].name);
    241                        
     241
    242242                        bootinfo.taskmap.cnt++;
    243243                }
    244                
     244
    245245                dest[i] = (void *) top;
    246246                top += components[i].inflated;
    247247                cnt++;
    248248        }
    249        
     249
    250250        printf("\nInflating components ... ");
    251        
     251
    252252        for (i = cnt; i > 0; i--) {
    253253                printf("%s ", components[i - 1].name);
    254                
     254
    255255                /*
    256256                 * At this point, we claim and map the physical memory that we
     
    263263                ofw_claim_phys(bootinfo.physmem_start + dest[i - 1],
    264264                    ALIGN_UP(components[i - 1].inflated, PAGE_SIZE));
    265                
     265
    266266                ofw_map(bootinfo.physmem_start + dest[i - 1], dest[i - 1],
    267267                    ALIGN_UP(components[i - 1].inflated, PAGE_SIZE), -1);
    268                
     268
    269269                int err = inflate(components[i - 1].addr, components[i - 1].size,
    270270                    dest[i - 1], components[i - 1].inflated);
    271                
     271
    272272                if (err != EOK) {
    273273                        printf("\n%s: Inflating error %d, halting.\n",
     
    276276                }
    277277        }
    278        
     278
    279279        printf(".\n");
    280        
     280
    281281        /*
    282282         * Claim and map the physical memory for the boot allocator.
     
    290290        balloc_init(&bootinfo.ballocs, balloc_base, (uintptr_t) balloc_base,
    291291            BALLOC_MAX_SIZE);
    292        
     292
    293293        printf("Setting up screens ...\n");
    294294        ofw_setup_screens();
    295        
     295
    296296        printf("Canonizing OpenFirmware device tree ...\n");
    297297        bootinfo.ofw_root = ofw_tree_build();
    298        
     298
    299299        if (arch == ARCH_SUN4U)
    300300                sun4u_smp();
    301        
     301
    302302        printf("Booting the kernel ...\n");
    303303        jump_to_kernel(bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, subarch,
Note: See TracChangeset for help on using the changeset viewer.