Changeset 4e7d3dd in mainline
- Timestamp:
- 2011-01-27T15:06:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0843f02
- Parents:
- bf75e3cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
rbf75e3cb r4e7d3dd 63 63 #include <debug.h> 64 64 65 static void before_task_runs(void);66 static void before_thread_runs(void);67 static void after_thread_ran(void);68 65 static void scheduler_separated_stack(void); 69 66 … … 71 68 72 69 /** Carry out actions before new task runs. */ 73 void before_task_runs(void)70 static void before_task_runs(void) 74 71 { 75 72 before_task_runs_arch(); … … 85 82 * 86 83 */ 87 void before_thread_runs(void)84 static void before_thread_runs(void) 88 85 { 89 86 before_thread_runs_arch(); 87 90 88 #ifdef CONFIG_FPU_LAZY 91 89 if(THREAD == CPU->fpu_owner) … … 113 111 * 114 112 */ 115 void after_thread_ran(void)113 static void after_thread_ran(void) 116 114 { 117 115 after_thread_ran_arch(); … … 391 389 * possible destruction should thread_destroy() be called on this or any 392 390 * other processor while the scheduler is still using them. 393 *394 391 */ 395 392 if (old_task) … … 417 414 * The thread structure is kept allocated until 418 415 * somebody calls thread_detach() on it. 419 *420 416 */ 421 417 if (!irq_spinlock_trylock(&THREAD->join_wq.lock)) { 422 418 /* 423 419 * Avoid deadlock. 424 *425 420 */ 426 421 irq_spinlock_unlock(&THREAD->lock, false); … … 443 438 /* 444 439 * Prefer the thread after it's woken up. 445 *446 440 */ 447 441 THREAD->priority = -1; … … 451 445 * waitq_sleep(). Address of wq->lock is kept in 452 446 * THREAD->sleep_queue. 453 *454 447 */ 455 448 irq_spinlock_unlock(&THREAD->sleep_queue->lock, false); … … 461 454 /* 462 455 * Entering state is unexpected. 463 *464 456 */ 465 457 panic("tid%" PRIu64 ": unexpected state %s.", … … 480 472 481 473 /* 482 * If both the old and the new task are the same, lots of work is 483 * avoided. 484 * 474 * If both the old and the new task are the same, 475 * lots of work is avoided. 485 476 */ 486 477 if (TASK != THREAD->task) { … … 488 479 489 480 /* 490 * Note that it is possible for two tasks to share one address 491 * space. 492 ( 481 * Note that it is possible for two tasks 482 * to share one address space. 493 483 */ 494 484 if (old_as != new_as) { … … 496 486 * Both tasks and address spaces are different. 497 487 * Replace the old one with the new one. 498 *499 488 */ 500 489 as_switch(old_as, new_as); … … 527 516 * necessary, is to be mapped in before_thread_runs(). This 528 517 * function must be executed before the switch to the new stack. 529 *530 518 */ 531 519 before_thread_runs(); … … 534 522 * Copy the knowledge of CPU, TASK, THREAD and preemption counter to 535 523 * thread's stack. 536 *537 524 */ 538 525 the_copy(THE, (the_t *) THREAD->kstack);
Note:
See TracChangeset
for help on using the changeset viewer.