Changeset 6f4495f5 in mainline for kernel/generic/src/main
- Timestamp:
- 2007-01-27T17:32:13Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ba41c5
- Parents:
- 51baa8a
- Location:
- kernel/generic/src/main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/kinit.c
r51baa8a r6f4495f5 99 99 * Just a beautification. 100 100 */ 101 if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, "kmp", true))) { 101 if ((t = thread_create(kmp, NULL, TASK, THREAD_FLAG_WIRED, 102 "kmp", true))) { 102 103 spinlock_lock(&t->lock); 103 104 t->cpu = &cpus[0]; … … 124 125 for (i = 0; i < config.cpu_count; i++) { 125 126 126 if ((t = thread_create(kcpulb, NULL, TASK, THREAD_FLAG_WIRED, "kcpulb", true))) { 127 if ((t = thread_create(kcpulb, NULL, TASK, 128 THREAD_FLAG_WIRED, "kcpulb", true))) { 127 129 spinlock_lock(&t->lock); 128 130 t->cpu = &cpus[i]; … … 144 146 * Create kernel console. 145 147 */ 146 if ((t = thread_create(kconsole, "kconsole", TASK, 0, "kconsole", false))) 148 t = thread_create(kconsole, "kconsole", TASK, 0, "kconsole", false); 149 if (t) 147 150 thread_ready(t); 148 151 else … … 162 165 } 163 166 164 task_t *utask = task_run_program((void *) init.tasks[i].addr, "uspace"); 167 task_t *utask = task_run_program((void *) init.tasks[i].addr, 168 "uspace"); 165 169 if (utask) { 166 170 /* 167 171 * Set capabilities to init userspace tasks. 168 172 */ 169 cap_set(utask, CAP_CAP | CAP_MEM_MANAGER | CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG); 173 cap_set(utask, CAP_CAP | CAP_MEM_MANAGER | 174 CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG); 170 175 171 176 if (!ipc_phone_0) 172 177 ipc_phone_0 = &utask->answerbox; 173 178 } else { 174 int rd = init_rd((rd_header *) init.tasks[i].addr, init.tasks[i].size); 179 int rd = init_rd((rd_header *) init.tasks[i].addr, 180 init.tasks[i].size); 175 181 176 182 if (rd != RE_OK) -
kernel/generic/src/main/main.c
r51baa8a r6f4495f5 147 147 148 148 config.kernel_size = ALIGN_UP(hardcoded_ktext_size + 149 hardcoded_kdata_size, PAGE_SIZE);149 hardcoded_kdata_size, PAGE_SIZE); 150 150 config.stack_size = CONFIG_STACK_SIZE; 151 151 … … 157 157 for (i = 0; i < init.cnt; i++) { 158 158 if (PA_overlaps(config.stack_base, config.stack_size, 159 init.tasks[i].addr, init.tasks[i].size))159 init.tasks[i].addr, init.tasks[i].size)) 160 160 config.stack_base = ALIGN_UP(init.tasks[i].addr + 161 init.tasks[i].size, config.stack_size);161 init.tasks[i].size, config.stack_size); 162 162 } 163 163 … … 165 165 if (ballocs.size) { 166 166 if (PA_overlaps(config.stack_base, config.stack_size, 167 ballocs.base, ballocs.size))167 ballocs.base, ballocs.size)) 168 168 config.stack_base = ALIGN_UP(ballocs.base + 169 ballocs.size, PAGE_SIZE);169 ballocs.size, PAGE_SIZE); 170 170 } 171 171 … … 175 175 context_save(&ctx); 176 176 context_set(&ctx, FADDR(main_bsp_separated_stack), config.stack_base, 177 THREAD_STACK_SIZE);177 THREAD_STACK_SIZE); 178 178 context_restore(&ctx); 179 179 /* not reached */ … … 223 223 version_print(); 224 224 printf("kernel: %.*p hardcoded_ktext_size=%zdK, " 225 "hardcoded_kdata_size=%zdK\n", sizeof(uintptr_t) * 2,226 config.base, hardcoded_ktext_size >> 10, hardcoded_kdata_size >>227 10);225 "hardcoded_kdata_size=%zdK\n", sizeof(uintptr_t) * 2, 226 config.base, hardcoded_ktext_size >> 10, 227 hardcoded_kdata_size >> 10); 228 228 printf("stack: %.*p size=%zdK\n", sizeof(uintptr_t) * 2, 229 config.stack_base, config.stack_size >> 10);229 config.stack_base, config.stack_size >> 10); 230 230 231 231 arch_pre_smp_init(); … … 250 250 for (i = 0; i < init.cnt; i++) 251 251 printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, 252 sizeof(uintptr_t) * 2, init.tasks[i].addr, i,253 init.tasks[i].size);252 sizeof(uintptr_t) * 2, init.tasks[i].addr, i, 253 init.tasks[i].size); 254 254 } else 255 255 printf("No init binaries found\n"); … … 324 324 */ 325 325 context_set(&CPU->saved_context, FADDR(main_ap_separated_stack), 326 (uintptr_t) CPU->stack, CPU_STACK_SIZE);326 (uintptr_t) CPU->stack, CPU_STACK_SIZE); 327 327 context_restore(&CPU->saved_context); 328 328 /* not reached */ -
kernel/generic/src/main/uinit.c
r51baa8a r6f4495f5 49 49 /** Thread used to bring up userspace thread. 50 50 * 51 * @param arg Pointer to structure containing userspace entry and stack addresses. 51 * @param arg Pointer to structure containing userspace entry and stack 52 * addresses. 52 53 */ 53 54 void uinit(void *arg)
Note:
See TracChangeset
for help on using the changeset viewer.
