Changeset c621f4aa in mainline for kernel/generic/src/main/kinit.c
- Timestamp:
- 2010-07-25T10:11:13Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 377cce8
- Parents:
- 24a2517 (diff), a2da43c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
kernel/generic/src/main/kinit.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r24a2517 rc621f4aa 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) { 127 128 /* 129 * For each CPU, create its load balancing thread. 130 */ 130 131 size_t i; 131 132 132 /*133 * For each CPU, create its load balancing thread.134 */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 … … 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 … … 175 180 if (init.tasks[i].addr % FRAME_SIZE) { 176 181 printf("init[%" PRIs "].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]);
Note:
See TracChangeset
for help on using the changeset viewer.
