Changeset 61e90dd in mainline for boot/arch/sparc64


Ignore:
Timestamp:
2006-09-19T22:42:57Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
16529d5
Parents:
3abe07f5
Message:

Add balloc() (a.k.a boot allocator):

  • balloc() only needs to know how to allocate memory.
  • Memory allocated via balloc() is supposed to be passed to kernel and never freed by boot itself.
  • make kernel aware of boot allocations

More work on OFW device tree:

  • use balloc() to efficiently and safely allocate memory for the canonical copy of the device tree

sparc64 boot:

  • pass OFW device tree root node pointer to kernel
Location:
boot/arch/sparc64/loader
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/loader/Makefile

    r3abe07f5 r61e90dd  
    5353        ../../../generic/printf.c \
    5454        ../../../generic/string.c \
     55        ../../../genarch/balloc.c \
    5556        ../../../genarch/ofw.c \
    5657        ../../../genarch/ofw_tree.c \
  • boot/arch/sparc64/loader/main.c

    r3abe07f5 r61e90dd  
    3131#include "asm.h"
    3232#include "_components.h"
     33#include <balloc.h>
    3334#include <ofw.h>
     35#include <ofw_tree.h>
    3436#include "ofwarch.h"
    3537#include <align.h>
     
    8486                printf(" %P: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size);
    8587
     88        void * base = (void *) KERNEL_VIRTUAL_ADDRESS;
     89        unsigned int top = 0;
     90
    8691        printf("\nCopying components\n");
    87         unsigned int top = 0;
    8892        bootinfo.taskmap.count = 0;
    8993        for (i = 0; i < COMPONENTS; i++) {
    90                 void * base = (void *) KERNEL_VIRTUAL_ADDRESS;
    91        
    9294                printf(" %s...", components[i].name);
    9395                top = ALIGN_UP(top, PAGE_SIZE);
     
    102104        }
    103105
     106        balloc_init(&bootinfo.ballocs, ALIGN_UP(((uintptr_t) base) + top, PAGE_SIZE));
     107
     108        printf("\nCanonizing OpenFirmware device tree...");
     109        bootinfo.ofw_root = ofw_tree_build();
     110        printf("done.\n");
     111
    104112        printf("\nBooting the kernel...\n");
    105113        jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo, sizeof(bootinfo));
  • boot/arch/sparc64/loader/main.h

    r3abe07f5 r61e90dd  
    3131
    3232#include <ofw.h>
     33#include <ofw_tree.h>
     34#include <balloc.h>
    3335#include <types.h>
    3436
     
    5557        keyboard_t keyboard;
    5658        cpu_t cpu;
     59        ballocs_t ballocs;
     60        ofw_tree_node_t *ofw_root;
    5761} bootinfo_t;
    5862
Note: See TracChangeset for help on using the changeset viewer.