Ignore:
File:
1 edited

Legend:

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

    r52c60b6 r2fa10f6  
    107107        if (config.cpu_count > 1) {
    108108                waitq_initialize(&ap_completion_wq);
     109               
    109110                /*
    110111                 * Create the kmp thread and wait for its completion.
     
    115116                thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true);
    116117                if (thread != NULL) {
    117                         spinlock_lock(&thread->lock);
     118                        irq_spinlock_lock(&thread->lock, false);
    118119                        thread->cpu = &cpus[0];
    119                         spinlock_unlock(&thread->lock);
     120                        irq_spinlock_unlock(&thread->lock, false);
    120121                        thread_ready(thread);
    121122                } else
     
    124125                thread_join(thread);
    125126                thread_detach(thread);
    126         }
    127        
    128         if (config.cpu_count > 1) {
     127               
     128                /*
     129                 * For each CPU, create its load balancing thread.
     130                 */
    129131                size_t i;
    130132               
    131                 /*
    132                  * For each CPU, create its load balancing thread.
    133                  */
    134133                for (i = 0; i < config.cpu_count; i++) {
    135134                        thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true);
    136135                        if (thread != NULL) {
    137                                 spinlock_lock(&thread->lock);
     136                                irq_spinlock_lock(&thread->lock, false);
    138137                                thread->cpu = &cpus[i];
    139                                 spinlock_unlock(&thread->lock);
     138                                irq_spinlock_unlock(&thread->lock, false);
    140139                                thread_ready(thread);
    141140                        } else
     
    181180                if (init.tasks[i].addr % FRAME_SIZE) {
    182181                        printf("init[%" PRIs "].addr is not frame aligned\n", i);
     182                        programs[i].task = NULL;
    183183                        continue;
    184184                }
     
    199199                str_cpy(namebuf + INIT_PREFIX_LEN,
    200200                    TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name);
    201 
     201               
    202202                int rc = program_create_from_image((void *) init.tasks[i].addr,
    203203                    namebuf, &programs[i]);
     
    208208                         */
    209209                        cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER |
    210                             CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG);
     210                            CAP_IO_MANAGER | CAP_IRQ_REG);
    211211                       
    212212                        if (!ipc_phone_0)
     
    222222                }
    223223        }
    224 
     224       
    225225        /*
    226226         * Run user tasks.
     
    230230                        program_ready(&programs[i]);
    231231        }
    232 
     232       
    233233#ifdef CONFIG_KCONSOLE
    234234        if (!stdin) {
Note: See TracChangeset for help on using the changeset viewer.