Ignore:
File:
1 edited

Legend:

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

    r9dae191e r263bda2  
    104104
    105105/** Lowest safe stack virtual address. */
    106 uintptr_t stack_safe = 0;               
     106uintptr_t stack_safe = 0;
    107107
    108108/*
     
    113113 */
    114114static void main_bsp_separated_stack(void);
     115
    115116#ifdef CONFIG_SMP
    116117static void main_ap_separated_stack(void);
    117118#endif
    118119
    119 #define CONFIG_STACK_SIZE       ((1 << STACK_FRAMES) * STACK_SIZE)
     120#define CONFIG_STACK_SIZE  ((1 << STACK_FRAMES) * STACK_SIZE)
    120121
    121122/** Main kernel routine for bootstrap CPU.
     
    151152                            init.tasks[i].size, config.stack_size);
    152153        }
    153 
     154       
    154155        /* Avoid placing stack on top of boot allocations. */
    155156        if (ballocs.size) {
     
    170171}
    171172
    172 
    173173/** Main kernel routine for bootstrap CPU using new stack.
    174174 *
     
    176176 *
    177177 */
    178 void main_bsp_separated_stack(void) 
     178void main_bsp_separated_stack(void)
    179179{
    180180        /* Keep this the first thing. */
     
    194194         * commands.
    195195         */
    196         LOG_EXEC(kconsole_init());
     196        kconsole_init();
    197197#endif
    198198       
     
    201201         * starts adding its own handlers
    202202         */
    203         LOG_EXEC(exc_init());
     203        exc_init();
    204204       
    205205        /*
    206206         * Memory management subsystems initialization.
    207207         */
    208         LOG_EXEC(arch_pre_mm_init());
    209         LOG_EXEC(frame_init());
     208        arch_pre_mm_init();
     209        frame_init();
    210210       
    211211        /* Initialize at least 1 memory segment big enough for slab to work. */
    212         LOG_EXEC(slab_cache_init());
    213         LOG_EXEC(sysinfo_init());
    214         LOG_EXEC(btree_init());
    215         LOG_EXEC(as_init());
    216         LOG_EXEC(page_init());
    217         LOG_EXEC(tlb_init());
    218         LOG_EXEC(ddi_init());
    219         LOG_EXEC(tasklet_init());
    220         LOG_EXEC(arch_post_mm_init());
    221         LOG_EXEC(arch_pre_smp_init());
    222         LOG_EXEC(smp_init());
     212        slab_cache_init();
     213        sysinfo_init();
     214        btree_init();
     215        as_init();
     216        page_init();
     217        tlb_init();
     218        ddi_init();
     219        tasklet_init();
     220        arch_post_mm_init();
     221        arch_pre_smp_init();
     222        smp_init();
    223223       
    224224        /* Slab must be initialized after we know the number of processors. */
    225         LOG_EXEC(slab_enable_cpucache());
     225        slab_enable_cpucache();
    226226       
    227227        printf("Detected %" PRIs " CPU(s), %" PRIu64" MiB free memory\n",
    228228            config.cpu_count, SIZE2MB(zones_total_size()));
    229 
    230         LOG_EXEC(cpu_init());
    231        
    232         LOG_EXEC(calibrate_delay_loop());
    233         LOG_EXEC(clock_counter_init());
    234         LOG_EXEC(timeout_init());
    235         LOG_EXEC(scheduler_init());
    236         LOG_EXEC(task_init());
    237         LOG_EXEC(thread_init());
    238         LOG_EXEC(futex_init());
     229       
     230        cpu_init();
     231       
     232        calibrate_delay_loop();
     233        clock_counter_init();
     234        timeout_init();
     235        scheduler_init();
     236        task_init();
     237        thread_init();
     238        futex_init();
    239239       
    240240        if (init.cnt > 0) {
     
    247247                printf("No init binaries found.\n");
    248248       
    249         LOG_EXEC(ipc_init());
    250         LOG_EXEC(event_init());
    251         LOG_EXEC(klog_init());
    252         LOG_EXEC(stats_init());
     249        ipc_init();
     250        event_init();
     251        klog_init();
     252        stats_init();
    253253       
    254254        /*
     
    266266        if (!kinit_thread)
    267267                panic("Cannot create kinit thread.");
    268         LOG_EXEC(thread_ready(kinit_thread));
     268        thread_ready(kinit_thread);
    269269       
    270270        /*
     
    276276}
    277277
    278 
    279278#ifdef CONFIG_SMP
     279
    280280/** Main kernel routine for application CPUs.
    281281 *
     
    296296         */
    297297        config.cpu_active++;
    298 
     298       
    299299        /*
    300300         * The THE structure is well defined because ctx.sp is used as stack.
     
    311311        calibrate_delay_loop();
    312312        arch_post_cpu_init();
    313 
     313       
    314314        the_copy(THE, (the_t *) CPU->stack);
    315 
     315       
    316316        /*
    317317         * If we woke kmp up before we left the kernel stack, we could
     
    326326}
    327327
    328 
    329328/** Main kernel routine for application CPUs using new stack.
    330329 *
     
    338337         */
    339338        timeout_init();
    340 
     339       
    341340        waitq_wakeup(&ap_completion_wq, WAKEUP_FIRST);
    342341        scheduler();
    343342        /* not reached */
    344343}
     344
    345345#endif /* CONFIG_SMP */
    346346
Note: See TracChangeset for help on using the changeset viewer.