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


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 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/kinit.c

    r3061bc1 ra35b458  
    102102{
    103103        thread_t *thread;
    104        
     104
    105105        /*
    106106         * Detach kinit as nobody will call thread_join_timeout() on it.
     
    109109
    110110        interrupts_disable();
    111        
     111
    112112        /* Start processing RCU callbacks. RCU is fully functional afterwards. */
    113113        rcu_kinit_init();
    114        
     114
    115115        /*
    116116         * Start processing work queue items. Some may have been queued during boot.
    117117         */
    118118        workq_global_worker_init();
    119        
     119
    120120#ifdef CONFIG_SMP
    121121        if (config.cpu_count > 1) {
    122122                waitq_initialize(&ap_completion_wq);
    123                
     123
    124124                /*
    125125                 * Create the kmp thread and wait for its completion.
     
    135135                } else
    136136                        panic("Unable to create kmp thread.");
    137                
     137
    138138                thread_join(thread);
    139139                thread_detach(thread);
    140                
     140
    141141                /*
    142142                 * For each CPU, create its load balancing thread.
    143143                 */
    144144                unsigned int i;
    145                
     145
    146146                for (i = 0; i < config.cpu_count; i++) {
    147147                        thread = thread_create(kcpulb, NULL, TASK,
     
    156156        }
    157157#endif /* CONFIG_SMP */
    158        
     158
    159159        /*
    160160         * At this point SMP, if present, is configured.
    161161         */
    162162        ARCH_OP(post_smp_init);
    163        
     163
    164164        /* Start thread computing system load */
    165165        thread = thread_create(kload, NULL, TASK, THREAD_FLAG_NONE,
     
    169169        else
    170170                log(LF_OTHER, LVL_ERROR, "Unable to create kload thread");
    171        
     171
    172172#ifdef CONFIG_KCONSOLE
    173173        if (stdin) {
     
    184184        }
    185185#endif /* CONFIG_KCONSOLE */
    186        
     186
    187187        /*
    188188         * Store the default stack size in sysinfo so that uspace can create
     
    190190         */
    191191        sysinfo_set_item_val("default.stack_size", NULL, STACK_SIZE_USER);
    192        
     192
    193193        interrupts_enable();
    194        
     194
    195195        /*
    196196         * Create user tasks, load RAM disk images.
     
    198198        size_t i;
    199199        program_t programs[CONFIG_INIT_TASKS];
    200        
     200
    201201        // FIXME: do not propagate arguments through sysinfo
    202202        // but pass them directly to the tasks
     
    228228                        continue;
    229229                }
    230                
     230
    231231                /*
    232232                 * Construct task name from the 'init:' prefix and the
    233233                 * name stored in the init structure (if any).
    234234                 */
    235                
     235
    236236                char namebuf[TASK_NAME_BUFLEN];
    237                
     237
    238238                const char *name = init.tasks[i].name;
    239239                if (name[0] == 0)
    240240                        name = "<unknown>";
    241                
     241
    242242                static_assert(TASK_NAME_BUFLEN >= INIT_PREFIX_LEN, "");
    243243                str_cpy(namebuf, TASK_NAME_BUFLEN, INIT_PREFIX);
    244244                str_cpy(namebuf + INIT_PREFIX_LEN,
    245245                    TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name);
    246                
     246
    247247                /*
    248248                 * Create virtual memory mappings for init task images.
     
    252252                    PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    253253                assert(page);
    254                
     254
    255255                errno_t rc = program_create_from_image((void *) page, namebuf,
    256256                    &programs[i]);
    257                
     257
    258258                if (rc == 0) {
    259259                        if (programs[i].task != NULL) {
     
    264264                                    PERM_PERM | PERM_MEM_MANAGER |
    265265                                    PERM_IO_MANAGER | PERM_IRQ_REG);
    266                                
     266
    267267                                if (!ipc_phone_0) {
    268268                                        ipc_phone_0 = &programs[i].task->answerbox;
     
    276276                                }
    277277                        }
    278                        
     278
    279279                        /*
    280280                         * If programs[i].task == NULL then it is
     
    293293                            str_error_name(rc), programs[i].loader_status);
    294294        }
    295        
     295
    296296        /*
    297297         * Run user tasks.
     
    301301                        program_ready(&programs[i]);
    302302        }
    303        
     303
    304304#ifdef CONFIG_KCONSOLE
    305305        if (!stdin) {
    306306                thread_sleep(10);
    307307                printf("kinit: No stdin\nKernel alive: .");
    308                
     308
    309309                unsigned int i = 0;
    310310                while (true) {
Note: See TracChangeset for help on using the changeset viewer.