Changeset b7068da in mainline for kernel/generic/src/main/main.c


Ignore:
Timestamp:
2012-02-09T20:35:12Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
591762c6
Parents:
7cede12c (diff), 3d4750f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/main.c

    r7cede12c rb7068da  
    6868#include <mm/page.h>
    6969#include <genarch/mm/page_pt.h>
     70#include <mm/km.h>
    7071#include <mm/tlb.h>
    7172#include <mm/as.h>
     
    8687#include <sysinfo/sysinfo.h>
    8788#include <sysinfo/stats.h>
     89#include <lib/ra.h>
    8890
    8991/** Global configuration structure. */
    90 config_t config;
     92config_t config = {
     93        .identity_configured = false,
     94        .non_identity_configured = false,
     95        .physmem_end = 0
     96};
    9197
    9298/** Initial user-space tasks */
     
    145151        size_t i;
    146152        for (i = 0; i < init.cnt; i++) {
    147                 if (PA_OVERLAPS(config.stack_base, config.stack_size,
    148                     init.tasks[i].addr, init.tasks[i].size))
    149                         config.stack_base = ALIGN_UP(init.tasks[i].addr +
    150                             init.tasks[i].size, config.stack_size);
     153                if (overlaps(KA2PA(config.stack_base), config.stack_size,
     154                    init.tasks[i].paddr, init.tasks[i].size)) {
     155                        /*
     156                         * The init task overlaps with the memory behind the
     157                         * kernel image so it must be in low memory and we can
     158                         * use PA2KA on the init task's physical address.
     159                         */
     160                        config.stack_base = ALIGN_UP(
     161                            PA2KA(init.tasks[i].paddr) + init.tasks[i].size,
     162                            config.stack_size);
     163                }
    151164        }
    152165       
     
    205218         */
    206219        arch_pre_mm_init();
     220        km_identity_init();
    207221        frame_init();
    208        
    209         /* Initialize at least 1 memory segment big enough for slab to work. */
    210222        slab_cache_init();
     223        ra_init();     
    211224        sysinfo_init();
    212225        btree_init();
     
    214227        page_init();
    215228        tlb_init();
     229        km_non_identity_init();
    216230        ddi_init();
    217231        arch_post_mm_init();
     
    262276         * Create the first thread.
    263277         */
    264         thread_t *kinit_thread
    265                 = thread_create(kinit, NULL, kernel, 0, "kinit", true);
     278        thread_t *kinit_thread =
     279            thread_create(kinit, NULL, kernel, 0, "kinit", true);
    266280        if (!kinit_thread)
    267281                panic("Cannot create kinit thread.");
Note: See TracChangeset for help on using the changeset viewer.