Changeset 6f4495f5 in mainline for kernel/generic/src/proc/thread.c
- Timestamp:
- 2007-01-27T17:32:13Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ba41c5
- Parents:
- 51baa8a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
r51baa8a r6f4495f5 205 205 atomic_set(&nrdy,0); 206 206 thread_slab = slab_cache_create("thread_slab", sizeof(thread_t), 0, 207 207 thr_constructor, thr_destructor, 0); 208 208 209 209 #ifdef ARCH_HAS_FPU 210 210 fpu_context_slab = slab_cache_create("fpu_slab", sizeof(fpu_context_t), 211 211 FPU_CONTEXT_ALIGN, NULL, NULL, 0); 212 212 #endif 213 213 … … 329 329 /* Not needed, but good for debugging */ 330 330 memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 331 331 0); 332 332 333 333 ipl = interrupts_disable(); … … 339 339 context_save(&t->saved_context); 340 340 context_set(&t->saved_context, FADDR(cushion), (uintptr_t) t->kstack, 341 341 THREAD_STACK_SIZE); 342 342 343 343 the_initialize((the_t *) t->kstack); … … 405 405 spinlock_lock(&threads_lock); 406 406 btree_insert(&threads_btree, (btree_key_t) ((uintptr_t) t), (void *) t, 407 407 NULL); 408 408 spinlock_unlock(&threads_lock); 409 409 … … 561 561 spinlock_lock(&threads_lock); 562 562 563 printf("tid name address state task ctx code stack cycles cpu kstack waitqueue\n"); 564 printf("------ ---------- ---------- -------- ---------- --- ---------- ---------- ---------- ---- ---------- ----------\n"); 565 566 for (cur = threads_btree.leaf_head.next; cur != &threads_btree.leaf_head; cur = cur->next) { 563 printf("tid name address state task ctx code " 564 " stack cycles cpu kstack waitqueue\n"); 565 printf("------ ---------- ---------- -------- ---------- --- --------" 566 "-- ---------- ---------- ---- ---------- ----------\n"); 567 568 for (cur = threads_btree.leaf_head.next; 569 cur != &threads_btree.leaf_head; cur = cur->next) { 567 570 btree_node_t *node; 568 571 int i; … … 578 581 order(t->cycles, &cycles, &suffix); 579 582 580 printf("%-6zd %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ", t->tid, t->name, t, thread_states[t->state], t->task, t->task->context, t->thread_code, t->kstack, cycles, suffix); 583 printf("%-6zd %-10s %#10zx %-8s %#10zx %-3ld %#10zx " 584 "%#10zx %9llu%c ", t->tid, t->name, t, 585 thread_states[t->state], t->task, t->task->context, 586 t->thread_code, t->kstack, cycles, suffix); 581 587 582 588 if (t->cpu) … … 586 592 587 593 if (t->state == Sleeping) 588 printf(" %#10zx %#10zx", t->kstack, t->sleep_queue); 594 printf(" %#10zx %#10zx", t->kstack, 595 t->sleep_queue); 589 596 590 597 printf("\n"); … … 609 616 btree_node_t *leaf; 610 617 611 return btree_search(&threads_btree, (btree_key_t) ((uintptr_t) t), &leaf) != NULL; 618 return btree_search(&threads_btree, (btree_key_t) ((uintptr_t) t), 619 &leaf) != NULL; 612 620 } 613 621 … … 648 656 } 649 657 650 if ((t = thread_create(uinit, kernel_uarg, TASK, THREAD_FLAG_USPACE, namebuf, false))) { 658 t = thread_create(uinit, kernel_uarg, TASK, THREAD_FLAG_USPACE, namebuf, 659 false); 660 if (t) { 651 661 tid = t->tid; 652 662 thread_ready(t); … … 671 681 /** @} 672 682 */ 683
Note:
See TracChangeset
for help on using the changeset viewer.