Ignore:
File:
1 edited

Legend:

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

    r339249f r5691653  
    190190        bootinfo.memmap.zones[0].start += OBP_BIAS;
    191191        bootinfo.memmap.zones[0].size -= OBP_BIAS;
     192        bootinfo.memmap.total -= OBP_BIAS;
    192193}
    193194
     
    204205        bootinfo.physmem_start = ofw_get_physmem_start();
    205206        ofw_memmap(&bootinfo.memmap);
     207
     208        if (arch == ARCH_SUN4V)
     209                sun4v_fixups();
    206210       
    207211        void *bootinfo_pa = ofw_translate(&bootinfo);
     
    209213        void *loader_address_pa = ofw_translate((void *) LOADER_ADDRESS);
    210214       
    211         printf("\nMemory statistics (total %llu MB, starting at %p)\n",
    212             bootinfo.memmap.total >> 20, bootinfo.physmem_start);
    213         printf(" %p|%p: boot info structure\n", &bootinfo, bootinfo_pa);
    214         printf(" %p|%p: kernel entry point\n", KERNEL_ADDRESS, kernel_address_pa);
    215         printf(" %p|%p: loader entry point\n", LOADER_ADDRESS, loader_address_pa);
     215        printf("\nMemory statistics (total %" PRIu64 " MB, starting at %p)\n",
     216            bootinfo.memmap.total >> 20, (void *) bootinfo.physmem_start);
     217        printf(" %p|%p: boot info structure\n", &bootinfo, (void *) bootinfo_pa);
     218        printf(" %p|%p: kernel entry point\n",
     219            (void *) KERNEL_ADDRESS, (void *) kernel_address_pa);
     220        printf(" %p|%p: loader entry point\n",
     221            (void *) LOADER_ADDRESS, (void *) loader_address_pa);
    216222       
    217223        size_t i;
    218224        for (i = 0; i < COMPONENTS; i++)
    219                 printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].start,
     225                printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].start,
    220226                    ofw_translate(components[i].start), components[i].name,
    221227                    components[i].inflated, components[i].size);
     
    251257               
    252258                /*
    253                  * At this point, we claim the physical memory that we are
    254                  * going to use. We should be safe in case of the virtual
     259                 * At this point, we claim and map the physical memory that we
     260                 * are going to use. We should be safe in case of the virtual
    255261                 * address space because the OpenFirmware, according to its
    256                  * SPARC binding, should restrict its use of virtual memory
    257                  * to addresses from [0xffd00000; 0xffefffff] and
    258                  * [0xfe000000; 0xfeffffff].
    259                  *
    260                  * We don't map this piece of memory. We simply rely on
    261                  * SILO to have it done for us already in this case.
    262                  *
    263                  * XXX SILO only maps 8 MB for us here. We should improve
    264                  *     this code to be totally independent on the behavior
    265                  *     of SILO.
    266                  *
     262                 * SPARC binding, should restrict its use of virtual memory to
     263                 * addresses from [0xffd00000; 0xffefffff] and [0xfe000000;
     264                 * 0xfeffffff].
    267265                 */
    268266                ofw_claim_phys(bootinfo.physmem_start + dest[i - 1],
    269267                    ALIGN_UP(components[i - 1].inflated, PAGE_SIZE));
     268               
     269                ofw_map(bootinfo.physmem_start + dest[i - 1], dest[i - 1],
     270                    ALIGN_UP(components[i - 1].inflated, PAGE_SIZE), -1);
    270271               
    271272                int err = inflate(components[i - 1].start, components[i - 1].size,
     
    302303                sun4u_smp();
    303304       
    304         if (arch == ARCH_SUN4V)
    305                 sun4v_fixups();
    306        
    307305        printf("Booting the kernel ...\n");
    308306        jump_to_kernel(bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, subarch,
Note: See TracChangeset for help on using the changeset viewer.