Changes in kernel/generic/src/main/main.c [d28bdbe:25939997] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/main.c
rd28bdbe r25939997 80 80 #include <arch/arch.h> 81 81 #include <arch.h> 82 #include <arch/faddr.h>83 82 #include <ipc/ipc.h> 84 83 #include <macros.h> … … 174 173 ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE); 175 174 176 context_save(&ctx); 177 context_set(&ctx, FADDR(main_bsp_separated_stack), 175 context_create(&ctx, main_bsp_separated_stack, 178 176 bootstrap_stack, bootstrap_stack_size); 179 177 context_restore(&ctx); … … 282 280 if (!kinit_thread) 283 281 panic("Cannot create kinit thread."); 284 thread_ready(kinit_thread); 285 286 /* 287 * This call to scheduler() will return to kinit, 282 thread_start(kinit_thread); 283 thread_detach(kinit_thread); 284 285 /* 286 * This call to scheduler_run() will return to kinit, 288 287 * starting the thread of kernel threads. 289 288 */ 290 scheduler(); 289 current_copy(CURRENT, (current_t *) CPU_LOCAL->stack); 290 context_replace(scheduler_run, CPU_LOCAL->stack, STACK_SIZE); 291 291 /* not reached */ 292 292 } … … 328 328 ARCH_OP(post_cpu_init); 329 329 330 current_copy(CURRENT, (current_t *) CPU->stack);331 332 330 /* 333 331 * If we woke kmp up before we left the kernel stack, we could … … 335 333 * switch to this cpu's private stack prior to waking kmp up. 336 334 */ 337 context_t ctx; 338 context_save(&ctx); 339 context_set(&ctx, FADDR(main_ap_separated_stack), 340 (uintptr_t) CPU->stack, STACK_SIZE); 341 context_restore(&ctx); 335 current_copy(CURRENT, (current_t *) CPU_LOCAL->stack); 336 context_replace(main_ap_separated_stack, CPU_LOCAL->stack, STACK_SIZE); 342 337 /* not reached */ 343 338 } … … 356 351 357 352 semaphore_up(&ap_completion_semaphore); 358 scheduler ();353 scheduler_run(); 359 354 /* not reached */ 360 355 }
Note:
See TracChangeset
for help on using the changeset viewer.