Ignore:
File:
1 edited

Legend:

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

    r1caeb2d r26aafe8  
    5858#include <proc/thread.h>
    5959#include <proc/task.h>
    60 #include <proc/tasklet.h>
    6160#include <main/kinit.h>
    6261#include <main/version.h>
     
    7271#include <mm/as.h>
    7372#include <mm/slab.h>
     73#include <mm/reserve.h>
    7474#include <synch/waitq.h>
    7575#include <synch/futex.h>
     
    118118#endif
    119119
    120 #define CONFIG_STACK_SIZE  ((1 << STACK_FRAMES) * STACK_SIZE)
    121 
    122120/** Main kernel routine for bootstrap CPU.
    123121 *
     
    139137        config.kernel_size = ALIGN_UP(hardcoded_ktext_size +
    140138            hardcoded_kdata_size, PAGE_SIZE);
    141         config.stack_size = CONFIG_STACK_SIZE;
     139        config.stack_size = STACK_SIZE;
    142140       
    143141        /* Initialy the stack is placed just after the kernel */
     
    165163       
    166164        context_save(&ctx);
    167         context_set(&ctx, FADDR(main_bsp_separated_stack), config.stack_base,
    168             THREAD_STACK_SIZE);
     165        context_set(&ctx, FADDR(main_bsp_separated_stack),
     166            config.stack_base, STACK_SIZE);
    169167        context_restore(&ctx);
    170168        /* not reached */
     
    217215        tlb_init();
    218216        ddi_init();
    219         tasklet_init();
    220217        arch_post_mm_init();
     218        reserve_init();
    221219        arch_pre_smp_init();
    222220        smp_init();
     
    225223        slab_enable_cpucache();
    226224       
    227         printf("Detected %u CPU(s), %" PRIu64 " MiB free memory\n",
    228             config.cpu_count, SIZE2MB(zones_total_size()));
     225        uint64_t size;
     226        const char *size_suffix;
     227        bin_order_suffix(zones_total_size(), &size, &size_suffix, false);
     228        printf("Detected %u CPU(s), %" PRIu64 " %s free memory\n",
     229            config.cpu_count, size, size_suffix);
    229230       
    230231        cpu_init();
     
    320321        context_save(&CPU->saved_context);
    321322        context_set(&CPU->saved_context, FADDR(main_ap_separated_stack),
    322             (uintptr_t) CPU->stack, CPU_STACK_SIZE);
     323            (uintptr_t) CPU->stack, STACK_SIZE);
    323324        context_restore(&CPU->saved_context);
    324325        /* not reached */
Note: See TracChangeset for help on using the changeset viewer.