Changeset ed7e057 in mainline for kernel/generic/src/proc/scheduler.c
- Timestamp:
- 2024-01-16T15:46:47Z (17 months ago)
- Branches:
- master
- Children:
- 29029ac0, a5b5f17
- Parents:
- 4ed7870
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-15 20:09:30)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-16 15:46:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
r4ed7870 red7e057 309 309 310 310 current_copy(CURRENT, (current_t *) CPU_LOCAL->stack); 311 312 context_t ctx; 313 context_save(&ctx); 314 context_set(&ctx, FADDR(scheduler_separated_stack), 315 (uintptr_t) CPU_LOCAL->stack, STACK_SIZE); 316 context_restore(&ctx); 317 311 context_replace(scheduler_separated_stack, CPU_LOCAL->stack, STACK_SIZE); 318 312 unreachable(); 319 313 } … … 452 446 /* Prefer the thread after it's woken up. */ 453 447 THREAD->priority = -1; 454 }455 456 if (!context_save(&THREAD->saved_context)) {457 /*458 * This is the place where threads leave scheduler();459 */460 461 irq_spinlock_unlock(&THREAD->lock, false);462 interrupts_restore(ipl);463 return;464 448 } 465 449 … … 486 470 */ 487 471 context_t ctx; 488 context_save(&ctx); 489 context_set(&ctx, FADDR(scheduler_separated_stack), 490 (uintptr_t) CPU_LOCAL->stack, STACK_SIZE); 491 context_restore(&ctx); 492 493 /* Not reached */ 472 context_create(&ctx, scheduler_separated_stack, 473 CPU_LOCAL->stack, STACK_SIZE); 474 475 /* Switch to scheduler context and store current thread's context. */ 476 context_swap(&THREAD->saved_context, &ctx); 477 478 /* Returned from scheduler. */ 479 480 irq_spinlock_unlock(&THREAD->lock, false); 481 interrupts_restore(ipl); 494 482 } 495 483
Note:
See TracChangeset
for help on using the changeset viewer.