Subversion Repositories HelenOS

Rev

Rev 2071 | Rev 2089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2087
Line 96... Line 96...
96
         * Create the kmp thread and wait for its completion.
96
         * Create the kmp thread and wait for its completion.
97
         * cpu1 through cpuN-1 will come up consecutively and
97
         * cpu1 through cpuN-1 will come up consecutively and
98
         * not mess together with kcpulb threads.
98
         * not mess together with kcpulb threads.
99
         * Just a beautification.
99
         * Just a beautification.
100
         */
100
         */
101
        if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true))) {
101
        if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED,
-
 
102
            "kmp", true))) {
102
            spinlock_lock(&t->lock);
103
            spinlock_lock(&t->lock);
103
            t->cpu = &cpus[0];
104
            t->cpu = &cpus[0];
104
            spinlock_unlock(&t->lock);
105
            spinlock_unlock(&t->lock);
105
            thread_ready(t);
106
            thread_ready(t);
106
        } else
107
        } else
Line 121... Line 122...
121
        /*
122
        /*
122
         * For each CPU, create its load balancing thread.
123
         * For each CPU, create its load balancing thread.
123
         */
124
         */
124
        for (i = 0; i < config.cpu_count; i++) {
125
        for (i = 0; i < config.cpu_count; i++) {
125
 
126
 
-
 
127
            if ((t = thread_create(kcpulb, NULL, TASK,
126
            if ((t = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true))) {
128
                THREAD_FLAG_WIRED, "kcpulb", true))) {
127
                spinlock_lock(&t->lock);           
129
                spinlock_lock(&t->lock);           
128
                t->cpu = &cpus[i];
130
                t->cpu = &cpus[i];
129
                spinlock_unlock(&t->lock);
131
                spinlock_unlock(&t->lock);
130
                thread_ready(t);
132
                thread_ready(t);
131
            } else
133
            } else
Line 141... Line 143...
141
    arch_post_smp_init();
143
    arch_post_smp_init();
142
 
144
 
143
    /*
145
    /*
144
     * Create kernel console.
146
     * Create kernel console.
145
     */
147
     */
146
    if ((t = thread_create(kconsole, "kconsole", TASK, 0, "kconsole", false)))
148
    t = thread_create(kconsole, "kconsole", TASK, 0, "kconsole", false);
-
 
149
    if (t)
147
        thread_ready(t);
150
        thread_ready(t);
148
    else
151
    else
149
        panic("thread_create/kconsole\n");
152
        panic("thread_create/kconsole\n");
150
 
153
 
151
    interrupts_enable();
154
    interrupts_enable();
Line 159... Line 162...
159
        if (init.tasks[i].addr % FRAME_SIZE) {
162
        if (init.tasks[i].addr % FRAME_SIZE) {
160
            printf("init[%d].addr is not frame aligned", i);
163
            printf("init[%d].addr is not frame aligned", i);
161
            continue;
164
            continue;
162
        }
165
        }
163
 
166
 
164
        task_t *utask = task_run_program((void *) init.tasks[i].addr, "uspace");
167
        task_t *utask = task_run_program((void *) init.tasks[i].addr,
-
 
168
            "uspace");
165
        if (utask) {
169
        if (utask) {
166
            /*
170
            /*
167
             * Set capabilities to init userspace tasks.
171
             * Set capabilities to init userspace tasks.
168
             */
172
             */
-
 
173
            cap_set(utask, CAP_CAP | CAP_MEM_MANAGER |
169
            cap_set(utask, CAP_CAP | CAP_MEM_MANAGER | CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG);
174
                CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG);
170
           
175
           
171
            if (!ipc_phone_0)
176
            if (!ipc_phone_0)
172
                ipc_phone_0 = &utask->answerbox;
177
                ipc_phone_0 = &utask->answerbox;
173
        } else {
178
        } else {
174
            int rd = init_rd((rd_header *) init.tasks[i].addr, init.tasks[i].size);
179
            int rd = init_rd((rd_header *) init.tasks[i].addr,
-
 
180
                init.tasks[i].size);
175
           
181
           
176
            if (rd != RE_OK)
182
            if (rd != RE_OK)
177
                printf("Init binary %zd not used.\n", i);
183
                printf("Init binary %zd not used.\n", i);
178
        }
184
        }
179
    }
185
    }