Changeset 97f1691 in mainline for generic/src/proc/scheduler.c
- Timestamp:
- 2006-02-28T00:02:39Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7d6ec87
- Parents:
- d87c3f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/proc/scheduler.c
rd87c3f3 r97f1691 50 50 atomic_t nrdy; 51 51 52 /** Take actions before new thread runs 52 /** Take actions before new thread runs. 53 53 * 54 54 * Perform actions that need to be … … 76 76 } 77 77 #endif 78 } 79 80 /** Take actions after old thread ran. 81 * 82 * Perform actions that need to be 83 * taken after the running thread 84 * was preempted by the scheduler. 85 * 86 * THREAD->lock is locked on entry 87 * 88 */ 89 void after_thread_ran(void) 90 { 91 after_thread_ran_arch(); 78 92 } 79 93 … … 258 272 259 273 if (THREAD) { 274 /* must be run after switch to scheduler stack */ 275 after_thread_ran(); 276 260 277 switch (THREAD->state) { 261 278 case Running: … … 301 318 break; 302 319 } 320 303 321 THREAD = NULL; 304 322 } … … 350 368 printf("cpu%d: tid %d (priority=%d,ticks=%d,nrdy=%d)\n", CPU->id, THREAD->tid, THREAD->priority, THREAD->ticks, atomic_get(&CPU->nrdy)); 351 369 #endif 370 371 /* 372 * Some architectures provide late kernel PA2KA(identity) 373 * mapping in a page fault handler. However, the page fault 374 * handler uses the kernel stack of the running thread and 375 * therefore cannot be used to map it. The kernel stack, if 376 * necessary, is to be mapped in before_thread_runs(). This 377 * function must be executed before the switch to the new stack. 378 */ 379 before_thread_runs(); 352 380 353 381 /* … … 388 416 * This is the place where threads leave scheduler(); 389 417 */ 390 before_thread_runs();391 418 spinlock_unlock(&THREAD->lock); 392 419 interrupts_restore(THREAD->saved_context.ipl);
Note:
See TracChangeset
for help on using the changeset viewer.