Changeset c98e6ee in mainline for kernel/generic/src/main/kinit.c
- Timestamp:
- 2008-07-08T16:05:45Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f93f168
- Parents:
- b7f9087
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
rb7f9087 rc98e6ee 48 48 #include <proc/task.h> 49 49 #include <proc/thread.h> 50 #include <proc/program.h> 50 51 #include <panic.h> 51 52 #include <func.h> … … 160 161 */ 161 162 count_t i; 162 thread_t *threads[CONFIG_INIT_TASKS];163 program_t programs[CONFIG_INIT_TASKS]; 163 164 164 165 for (i = 0; i < init.cnt; i++) { … … 168 169 } 169 170 170 threads[i] = thread_create_program((void *) init.tasks[i].addr,171 "uspace");172 173 if ( threads[i]!= NULL) {171 int rc = program_create_from_image((void *) init.tasks[i].addr, 172 &programs[i]); 173 174 if (rc == 0 && programs[i].task != NULL) { 174 175 /* 175 176 * Set capabilities to init userspace tasks. 176 177 */ 177 cap_set( threads[i]->task, CAP_CAP | CAP_MEM_MANAGER |178 cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER | 178 179 CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG); 180 179 181 180 182 if (!ipc_phone_0) 181 ipc_phone_0 = &threads[i]->task->answerbox; 183 ipc_phone_0 = &programs[i].task->answerbox; 184 } else if (rc == 0) { 185 /* It was the program loader and was registered */ 182 186 } else { 187 /* RAM disk image */ 183 188 int rd = init_rd((rd_header_t *) init.tasks[i].addr, 184 189 init.tasks[i].size); … … 194 199 */ 195 200 for (i = 0; i < init.cnt; i++) { 196 if ( threads[i]!= NULL) {201 if (programs[i].task != NULL) { 197 202 thread_usleep(50000); 198 thread_ready(threads[i]);203 program_ready(&programs[i]); 199 204 } 200 205 }
Note:
See TracChangeset
for help on using the changeset viewer.