Changes in kernel/generic/src/main/kinit.c [52c60b6:2fa10f6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r52c60b6 r2fa10f6 107 107 if (config.cpu_count > 1) { 108 108 waitq_initialize(&ap_completion_wq); 109 109 110 /* 110 111 * Create the kmp thread and wait for its completion. … … 115 116 thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true); 116 117 if (thread != NULL) { 117 spinlock_lock(&thread->lock);118 irq_spinlock_lock(&thread->lock, false); 118 119 thread->cpu = &cpus[0]; 119 spinlock_unlock(&thread->lock);120 irq_spinlock_unlock(&thread->lock, false); 120 121 thread_ready(thread); 121 122 } else … … 124 125 thread_join(thread); 125 126 thread_detach(thread); 126 } 127 128 if (config.cpu_count > 1) { 127 128 /* 129 * For each CPU, create its load balancing thread. 130 */ 129 131 size_t i; 130 132 131 /*132 * For each CPU, create its load balancing thread.133 */134 133 for (i = 0; i < config.cpu_count; i++) { 135 134 thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true); 136 135 if (thread != NULL) { 137 spinlock_lock(&thread->lock);136 irq_spinlock_lock(&thread->lock, false); 138 137 thread->cpu = &cpus[i]; 139 spinlock_unlock(&thread->lock);138 irq_spinlock_unlock(&thread->lock, false); 140 139 thread_ready(thread); 141 140 } else … … 181 180 if (init.tasks[i].addr % FRAME_SIZE) { 182 181 printf("init[%" PRIs "].addr is not frame aligned\n", i); 182 programs[i].task = NULL; 183 183 continue; 184 184 } … … 199 199 str_cpy(namebuf + INIT_PREFIX_LEN, 200 200 TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name); 201 201 202 202 int rc = program_create_from_image((void *) init.tasks[i].addr, 203 203 namebuf, &programs[i]); … … 208 208 */ 209 209 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); 211 211 212 212 if (!ipc_phone_0) … … 222 222 } 223 223 } 224 224 225 225 /* 226 226 * Run user tasks. … … 230 230 program_ready(&programs[i]); 231 231 } 232 232 233 233 #ifdef CONFIG_KCONSOLE 234 234 if (!stdin) {
Note:
See TracChangeset
for help on using the changeset viewer.