Changeset 61e90dd in mainline for kernel/generic/src/main/main.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
  • kernel/generic/src/main/main.c

    r3abe07f5 r61e90dd  
    9595};
    9696
     97/** Boot allocations. */
     98ballocs_t ballocs = {
     99        .base = NULL,
     100        .size = 0
     101};
     102
    97103context_t ctx;
    98104
     
    106112size_t hardcoded_kdata_size = 0;        /**< Size of the kernel data in bytes. */
    107113
    108 uintptr_t stack_safe = 0;       /**< Lowest safe stack virtual address */
     114uintptr_t stack_safe = 0;               /**< Lowest safe stack virtual address */
    109115
    110116void main_bsp(void);
     
    152158                if (PA_overlaps(config.stack_base, config.stack_size, init.tasks[i].addr, init.tasks[i].size))
    153159                        config.stack_base = ALIGN_UP(init.tasks[i].addr + init.tasks[i].size, config.stack_size);
     160        }
     161
     162        /* Avoid placing stack on top of boot allocations. */
     163        if (ballocs.size) {
     164                if (PA_overlaps(config.stack_base, config.stack_size, ballocs.base, ballocs.size))
     165                        config.stack_base = ALIGN_UP(ballocs.base + ballocs.size, PAGE_SIZE);
    154166        }
    155167       
Note: See TracChangeset for help on using the changeset viewer.