Changeset 61e90dd in mainline for boot/genarch/ofw_tree.c


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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/genarch/ofw_tree.c

    r3abe07f5 r61e90dd  
    3131#include <types.h>
    3232#include <string.h>
     33#include <balloc.h>
    3334
    3435static ofw_tree_node_t *ofw_tree_node_alloc(void)
    3536{
    36         return NULL;
     37        return balloc(sizeof(ofw_tree_node_t), sizeof(ofw_tree_node_t));
    3738}
    3839
    3940static ofw_tree_property_t *ofw_tree_properties_alloc(unsigned count)
    4041{
    41         return NULL;
     42        return balloc(count * sizeof(ofw_tree_property_t), sizeof(ofw_tree_property_t));
    4243}
    4344
    4445static void * ofw_tree_space_alloc(size_t size)
    4546{
    46         return NULL;
     47        return balloc(size, size);
    4748}
    4849
Note: See TracChangeset for help on using the changeset viewer.