Changeset 201abde in mainline for kernel/generic/src/proc
- Timestamp:
- 2007-04-07T20:06:52Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7e58979
- Parents:
- 6adbe3c2
- Location:
- kernel/generic/src/proc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
r6adbe3c2 r201abde 451 451 * Entering state is unexpected. 452 452 */ 453 panic("tid% d: unexpected state %s\n", THREAD->tid,453 panic("tid%llu: unexpected state %s\n", THREAD->tid, 454 454 thread_states[THREAD->state]); 455 455 break; … … 504 504 505 505 #ifdef SCHEDULER_VERBOSE 506 printf("cpu%d: tid % d (priority=%d, ticks=%lld, nrdy=%ld)\n",506 printf("cpu%d: tid %llu (priority=%d, ticks=%llu, nrdy=%ld)\n", 507 507 CPU->id, THREAD->tid, THREAD->priority, THREAD->ticks, 508 508 atomic_get(&CPU->nrdy)); … … 640 640 spinlock_lock(&t->lock); 641 641 #ifdef KCPULB_VERBOSE 642 printf("kcpulb%d: TID % d-> cpu%d, nrdy=%ld, "642 printf("kcpulb%d: TID %llu -> cpu%d, nrdy=%ld, " 643 643 "avg=%nd\n", CPU->id, t->tid, CPU->id, 644 644 atomic_get(&CPU->nrdy), … … 723 723 cur = cur->next) { 724 724 t = list_get_instance(cur, thread_t, rq_link); 725 printf("% d(%s) ", t->tid,725 printf("%llu(%s) ", t->tid, 726 726 thread_states[t->state]); 727 727 } -
kernel/generic/src/proc/task.c
r6adbe3c2 r201abde 400 400 order(task_get_accounting(t), &cycles, &suffix); 401 401 402 printf("%-6ll d%-10s %-3ld %#10zx %#10zx %9llu%c %7zd "402 printf("%-6llu %-10s %-3ld %#10zx %#10zx %9llu%c %7zd " 403 403 "%6zd", t->taskid, t->name, t->context, t, t->as, 404 404 cycles, suffix, t->refcount, … … 487 487 ipc_cleanup(); 488 488 futex_cleanup(); 489 klog_printf("Cleanup of task %ll dcompleted.", TASK->taskid);489 klog_printf("Cleanup of task %llu completed.", TASK->taskid); 490 490 } 491 491 -
kernel/generic/src/proc/thread.c
r6adbe3c2 r201abde 95 95 96 96 SPINLOCK_INITIALIZE(tidlock); 97 uint32_t last_tid = 0;97 thread_id_t last_tid = 0; 98 98 99 99 static slab_cache_t *thread_slab; … … 581 581 order(t->cycles, &cycles, &suffix); 582 582 583 printf("%-6 zd%-10s %#10zx %-8s %#10zx %-3ld %#10zx "583 printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx " 584 584 "%#10zx %9llu%c ", t->tid, t->name, t, 585 585 thread_states[t->state], t->task, t->task->context, … … 637 637 * 638 638 */ 639 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name )639 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, thread_id_t *uspace_thread_id) 640 640 { 641 641 thread_t *t; 642 642 char namebuf[THREAD_NAME_BUFLEN]; 643 643 uspace_arg_t *kernel_uarg; 644 uint32_t tid;645 644 int rc; 646 645 … … 659 658 false); 660 659 if (t) { 661 tid = t->tid;662 660 thread_ready(t); 663 return (unative_t) tid; 664 } else { 661 if (uspace_thread_id != NULL) 662 return (unative_t) copy_to_uspace(uspace_thread_id, &t->tid, 663 sizeof(t->tid)); 664 else 665 return 0; 666 } else 665 667 free(kernel_uarg); 666 }667 668 668 669 return (unative_t) ENOMEM; … … 681 682 /** Syscall for getting TID. 682 683 * 683 * @return Thread ID. 684 */ 685 unative_t sys_thread_get_id(void) 684 * @param uspace_thread_id Userspace address of 8-byte buffer where to store 685 * current thread ID. 686 * 687 * @return 0 on success or an error code from @ref errno.h. 688 */ 689 unative_t sys_thread_get_id(thread_id_t *uspace_thread_id) 686 690 { 687 691 /* … … 689 693 * remains constant for the lifespan of the thread. 690 694 */ 691 return THREAD->tid; 695 return (unative_t) copy_to_uspace(uspace_thread_id, &THREAD->tid, 696 sizeof(THREAD->tid)); 692 697 } 693 698
Note:
See TracChangeset
for help on using the changeset viewer.