Changes in kernel/generic/src/main/kinit.c [7e752b2:98000fb] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r7e752b2 r98000fb 66 66 #include <ipc/ipc.h> 67 67 #include <debug.h> 68 #include <str.h> 69 #include <sysinfo/stats.h> 68 #include <string.h> 70 69 71 70 #ifdef CONFIG_SMP … … 95 94 void kinit(void *arg) 96 95 { 96 97 #if defined(CONFIG_SMP) || defined(CONFIG_KCONSOLE) 97 98 thread_t *thread; 99 #endif 98 100 99 101 /* … … 107 109 if (config.cpu_count > 1) { 108 110 waitq_initialize(&ap_completion_wq); 109 110 111 /* 111 112 * Create the kmp thread and wait for its completion. … … 116 117 thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true); 117 118 if (thread != NULL) { 118 irq_spinlock_lock(&thread->lock, false);119 spinlock_lock(&thread->lock); 119 120 thread->cpu = &cpus[0]; 120 irq_spinlock_unlock(&thread->lock, false);121 spinlock_unlock(&thread->lock); 121 122 thread_ready(thread); 122 123 } else 123 124 panic("Unable to create kmp thread."); 124 125 125 thread_join(thread); 126 126 thread_detach(thread); 127 } 128 129 if (config.cpu_count > 1) { 130 size_t i; 127 131 128 132 /* 129 133 * For each CPU, create its load balancing thread. 130 134 */ 131 unsigned int i;132 133 135 for (i = 0; i < config.cpu_count; i++) { 134 136 thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true); 135 137 if (thread != NULL) { 136 irq_spinlock_lock(&thread->lock, false);138 spinlock_lock(&thread->lock); 137 139 thread->cpu = &cpus[i]; 138 irq_spinlock_unlock(&thread->lock, false);140 spinlock_unlock(&thread->lock); 139 141 thread_ready(thread); 140 142 } else 141 printf("Unable to create kcpulb thread for cpu %u\n", i);143 printf("Unable to create kcpulb thread for cpu" PRIs "\n", i); 142 144 } 143 145 } … … 148 150 */ 149 151 arch_post_smp_init(); 150 151 /* Start thread computing system load */152 thread = thread_create(kload, NULL, TASK, 0, "kload", false);153 if (thread != NULL)154 thread_ready(thread);155 else156 printf("Unable to create kload thread\n");157 152 158 153 #ifdef CONFIG_KCONSOLE … … 179 174 for (i = 0; i < init.cnt; i++) { 180 175 if (init.tasks[i].addr % FRAME_SIZE) { 181 printf("init[%zu].addr is not frame aligned\n", i); 182 programs[i].task = NULL; 176 printf("init[%" PRIs "].addr is not frame aligned\n", i); 183 177 continue; 184 178 } … … 190 184 191 185 char namebuf[TASK_NAME_BUFLEN]; 192 193 const char *name = init.tasks[i].name; 186 char *name; 187 188 name = init.tasks[i].name; 194 189 if (name[0] == 0) 195 190 name = "<unknown>"; … … 199 194 str_cpy(namebuf + INIT_PREFIX_LEN, 200 195 TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name); 201 196 202 197 int rc = program_create_from_image((void *) init.tasks[i].addr, 203 198 namebuf, &programs[i]); … … 208 203 */ 209 204 cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER | 210 CAP_IO_MANAGER | CAP_ IRQ_REG);205 CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG); 211 206 212 207 if (!ipc_phone_0) … … 219 214 220 215 if (rd != RE_OK) 221 printf("Init binary % zunot used (error %d)\n", i, rd);216 printf("Init binary %" PRIs " not used (error %d)\n", i, rd); 222 217 } 223 218 }
Note:
See TracChangeset
for help on using the changeset viewer.