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


Ignore:
Timestamp:
2018-03-02T20:10:49Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    166166        config.cpu_count = 1;
    167167        config.cpu_active = 1;
    168        
     168
    169169        config.base = hardcoded_load_address;
    170170        config.kernel_size = ALIGN_UP(hardcoded_ktext_size +
    171171            hardcoded_kdata_size, PAGE_SIZE);
    172172        config.stack_size = STACK_SIZE;
    173        
     173
    174174        /* Initialy the stack is placed just after the kernel */
    175175        config.stack_base = config.base + config.kernel_size;
    176        
     176
    177177        /* Avoid placing stack on top of init */
    178178        size_t i;
     
    190190                }
    191191        }
    192        
     192
    193193        /* Avoid placing stack on top of boot allocations. */
    194194        if (ballocs.size) {
     
    198198                            ballocs.size, PAGE_SIZE);
    199199        }
    200        
     200
    201201        if (config.stack_base < stack_safe)
    202202                config.stack_base = ALIGN_UP(stack_safe, PAGE_SIZE);
    203        
     203
    204204        context_save(&ctx);
    205205        context_set(&ctx, FADDR(main_bsp_separated_stack),
     
    218218        /* Keep this the first thing. */
    219219        the_initialize(THE);
    220        
     220
    221221        version_print();
    222        
     222
    223223        LOG("\nconfig.base=%p config.kernel_size=%zu"
    224224            "\nconfig.stack_base=%p config.stack_size=%zu",
    225225            (void *) config.base, config.kernel_size,
    226226            (void *) config.stack_base, config.stack_size);
    227        
     227
    228228#ifdef CONFIG_KCONSOLE
    229229        /*
     
    234234        kconsole_init();
    235235#endif
    236        
     236
    237237        /*
    238238         * Exception handler initialization, before architecture
     
    240240         */
    241241        exc_init();
    242        
     242
    243243        /*
    244244         * Memory management subsystems initialization.
     
    260260        ARCH_OP(pre_smp_init);
    261261        smp_init();
    262        
     262
    263263        /* Slab must be initialized after we know the number of processors. */
    264264        slab_enable_cpucache();
    265        
     265
    266266        uint64_t size;
    267267        const char *size_suffix;
     
    269269        printf("Detected %u CPU(s), %" PRIu64 " %s free memory\n",
    270270            config.cpu_count, size, size_suffix);
    271        
     271
    272272        cpu_init();
    273273        calibrate_delay_loop();
     
    293293        } else
    294294                printf("No init binaries found.\n");
    295        
     295
    296296        ipc_init();
    297297        event_init();
     
    299299        log_init();
    300300        stats_init();
    301        
     301
    302302        /*
    303303         * Create kernel task.
     
    306306        if (!kernel)
    307307                panic("Cannot create kernel task.");
    308        
     308
    309309        /*
    310310         * Create the first thread.
     
    315315                panic("Cannot create kinit thread.");
    316316        thread_ready(kinit_thread);
    317        
     317
    318318        /*
    319319         * This call to scheduler() will return to kinit,
     
    344344         */
    345345        config.cpu_active++;
    346        
     346
    347347        /*
    348348         * The THE structure is well defined because ctx.sp is used as stack.
    349349         */
    350350        the_initialize(THE);
    351        
     351
    352352        ARCH_OP(pre_mm_init);
    353353        frame_init();
     
    355355        tlb_init();
    356356        ARCH_OP(post_mm_init);
    357        
     357
    358358        cpu_init();
    359359        calibrate_delay_loop();
    360360        ARCH_OP(post_cpu_init);
    361        
     361
    362362        the_copy(THE, (the_t *) CPU->stack);
    363        
     363
    364364        /*
    365365         * If we woke kmp up before we left the kernel stack, we could
     
    382382{
    383383        smp_call_init();
    384        
     384
    385385        /*
    386386         * Configure timeouts for this cpu.
    387387         */
    388388        timeout_init();
    389        
     389
    390390        waitq_wakeup(&ap_completion_wq, WAKEUP_FIRST);
    391391        scheduler();
Note: See TracChangeset for help on using the changeset viewer.