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