Changes in kernel/generic/src/main/kinit.c [db675dd:c8cbd39] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
rdb675dd rc8cbd39 69 69 #include <str.h> 70 70 #include <sysinfo/stats.h> 71 #include <sysinfo/sysinfo.h> 71 72 #include <align.h> 72 73 … … 116 117 * Just a beautification. 117 118 */ 118 thread = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true); 119 thread = thread_create(kmp, NULL, TASK, 120 THREAD_FLAG_UNCOUNTED, "kmp"); 119 121 if (thread != NULL) { 120 irq_spinlock_lock(&thread->lock, false); 121 thread->cpu = &cpus[0]; 122 irq_spinlock_unlock(&thread->lock, false); 122 thread_wire(thread, &cpus[0]); 123 123 thread_ready(thread); 124 124 } else … … 134 134 135 135 for (i = 0; i < config.cpu_count; i++) { 136 thread = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true); 136 thread = thread_create(kcpulb, NULL, TASK, 137 THREAD_FLAG_UNCOUNTED, "kcpulb"); 137 138 if (thread != NULL) { 138 irq_spinlock_lock(&thread->lock, false); 139 thread->cpu = &cpus[i]; 140 irq_spinlock_unlock(&thread->lock, false); 139 thread_wire(thread, &cpus[i]); 141 140 thread_ready(thread); 142 141 } else … … 152 151 153 152 /* Start thread computing system load */ 154 thread = thread_create(kload, NULL, TASK, 0, "kload", false); 153 thread = thread_create(kload, NULL, TASK, THREAD_FLAG_NONE, 154 "kload"); 155 155 if (thread != NULL) 156 156 thread_ready(thread); … … 163 163 * Create kernel console. 164 164 */ 165 thread = thread_create(kconsole_thread, NULL, TASK, 0, "kconsole", false); 165 thread = thread_create(kconsole_thread, NULL, TASK, 166 THREAD_FLAG_NONE, "kconsole"); 166 167 if (thread != NULL) 167 168 thread_ready(thread); … … 179 180 program_t programs[CONFIG_INIT_TASKS]; 180 181 182 // FIXME: do not propagate arguments through sysinfo 183 // but pass them directly to the tasks 184 for (i = 0; i < init.cnt; i++) { 185 const char *arguments = init.tasks[i].arguments; 186 if (str_length(arguments) == 0) 187 continue; 188 if (str_length(init.tasks[i].name) == 0) 189 continue; 190 size_t arguments_size = str_size(arguments); 191 192 void *arguments_copy = malloc(arguments_size, 0); 193 if (arguments_copy == NULL) 194 continue; 195 memcpy(arguments_copy, arguments, arguments_size); 196 197 char item_name[CONFIG_TASK_NAME_BUFLEN + 15]; 198 snprintf(item_name, CONFIG_TASK_NAME_BUFLEN + 15, 199 "init_args.%s", init.tasks[i].name); 200 201 sysinfo_set_item_data(item_name, NULL, arguments_copy, arguments_size); 202 } 203 181 204 for (i = 0; i < init.cnt; i++) { 182 205 if (init.tasks[i].paddr % FRAME_SIZE) {
Note:
See TracChangeset
for help on using the changeset viewer.