Changes in kernel/generic/src/main/kinit.c [2fa10f6:52c60b6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r2fa10f6 r52c60b6 107 107 if (config.cpu_count > 1) { 108 108 waitq_initialize(&ap_completion_wq); 109 110 109 /* 111 110 * Create the kmp thread and wait for its completion. … … 116 115 thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true); 117 116 if (thread != NULL) { 118 irq_spinlock_lock(&thread->lock, false);117 spinlock_lock(&thread->lock); 119 118 thread->cpu = &cpus[0]; 120 irq_spinlock_unlock(&thread->lock, false);119 spinlock_unlock(&thread->lock); 121 120 thread_ready(thread); 122 121 } else … … 125 124 thread_join(thread); 126 125 thread_detach(thread); 126 } 127 128 if (config.cpu_count > 1) { 129 size_t i; 127 130 128 131 /* 129 132 * For each CPU, create its load balancing thread. 130 133 */ 131 size_t i;132 133 134 for (i = 0; i < config.cpu_count; i++) { 134 135 thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true); 135 136 if (thread != NULL) { 136 irq_spinlock_lock(&thread->lock, false);137 spinlock_lock(&thread->lock); 137 138 thread->cpu = &cpus[i]; 138 irq_spinlock_unlock(&thread->lock, false);139 spinlock_unlock(&thread->lock); 139 140 thread_ready(thread); 140 141 } else … … 180 181 if (init.tasks[i].addr % FRAME_SIZE) { 181 182 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_ IRQ_REG);210 CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | 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.