Changeset 201abde in mainline for kernel/generic/src


Ignore:
Timestamp:
2007-04-07T20:06:52Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e58979
Parents:
6adbe3c2
Message:

make thread ID 64 bit (task ID is 64 bit already)
cleanup thread syscalls

Location:
kernel/generic/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/btree.c

    r6adbe3c2 r201abde  
    971971                printf("(");
    972972                for (i = 0; i < node->keys; i++) {
    973                         printf("%lld%s", node->key[i], i < node->keys - 1 ? "," : "");
     973                        printf("%llu%s", node->key[i], i < node->keys - 1 ? "," : "");
    974974                        if (node->depth && node->subtree[i]) {
    975975                                list_append(&node->subtree[i]->bfs_link, &head);
     
    993993                printf("(");
    994994                for (i = 0; i < node->keys; i++)
    995                         printf("%lld%s", node->key[i], i < node->keys - 1 ? "," : "");
     995                        printf("%llu%s", node->key[i], i < node->keys - 1 ? "," : "");
    996996                printf(")");
    997997        }
  • kernel/generic/src/console/cmd.c

    r6adbe3c2 r201abde  
    714714int cmd_set4(cmd_arg_t *argv)
    715715{
    716         uint32_t *addr ;
     716        uint32_t *addr;
    717717        uint32_t arg1 = argv[1].intval;
    718718        bool pointer = false;
  • kernel/generic/src/ipc/ipc.c

    r6adbe3c2 r201abde  
    503503        for (tmp=task->answerbox.calls.next; tmp != &task->answerbox.calls;tmp = tmp->next) {
    504504                call = list_get_instance(tmp, call_t, link);
    505                 printf("Callid: %p Srctask:%lld M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
     505                printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
    506506                       call->sender->taskid, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
    507507                       IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), call->flags);
     
    513513             tmp = tmp->next) {
    514514                call = list_get_instance(tmp, call_t, link);
    515                 printf("Callid: %p Srctask:%lld M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
     515                printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
    516516                       call->sender->taskid, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
    517517                       IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), call->flags);
  • kernel/generic/src/proc/scheduler.c

    r6adbe3c2 r201abde  
    451451                         * Entering state is unexpected.
    452452                         */
    453                         panic("tid%d: unexpected state %s\n", THREAD->tid,
     453                        panic("tid%llu: unexpected state %s\n", THREAD->tid,
    454454                                thread_states[THREAD->state]);
    455455                        break;
     
    504504
    505505#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",
    507507            CPU->id, THREAD->tid, THREAD->priority, THREAD->ticks,
    508508            atomic_get(&CPU->nrdy));
     
    640640                                spinlock_lock(&t->lock);
    641641#ifdef KCPULB_VERBOSE
    642                                 printf("kcpulb%d: TID %d -> cpu%d, nrdy=%ld, "
     642                                printf("kcpulb%d: TID %llu -> cpu%d, nrdy=%ld, "
    643643                                    "avg=%nd\n", CPU->id, t->tid, CPU->id,
    644644                                    atomic_get(&CPU->nrdy),
     
    723723                                cur = cur->next) {
    724724                                t = list_get_instance(cur, thread_t, rq_link);
    725                                 printf("%d(%s) ", t->tid,
     725                                printf("%llu(%s) ", t->tid,
    726726                                    thread_states[t->state]);
    727727                        }
  • kernel/generic/src/proc/task.c

    r6adbe3c2 r201abde  
    400400                        order(task_get_accounting(t), &cycles, &suffix);
    401401                       
    402                         printf("%-6lld %-10s %-3ld %#10zx %#10zx %9llu%c %7zd "
     402                        printf("%-6llu %-10s %-3ld %#10zx %#10zx %9llu%c %7zd "
    403403                            "%6zd", t->taskid, t->name, t->context, t, t->as,
    404404                            cycles, suffix, t->refcount,
     
    487487        ipc_cleanup();
    488488        futex_cleanup();
    489         klog_printf("Cleanup of task %lld completed.", TASK->taskid);
     489        klog_printf("Cleanup of task %llu completed.", TASK->taskid);
    490490}
    491491
  • kernel/generic/src/proc/thread.c

    r6adbe3c2 r201abde  
    9595
    9696SPINLOCK_INITIALIZE(tidlock);
    97 uint32_t last_tid = 0;
     97thread_id_t last_tid = 0;
    9898
    9999static slab_cache_t *thread_slab;
     
    581581                        order(t->cycles, &cycles, &suffix);
    582582                       
    583                         printf("%-6zd %-10s %#10zx %-8s %#10zx %-3ld %#10zx "
     583                        printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx "
    584584                            "%#10zx %9llu%c ", t->tid, t->name, t,
    585585                            thread_states[t->state], t->task, t->task->context,
     
    637637 *
    638638 */
    639 unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)
     639unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, thread_id_t *uspace_thread_id)
    640640{
    641641        thread_t *t;
    642642        char namebuf[THREAD_NAME_BUFLEN];
    643643        uspace_arg_t *kernel_uarg;
    644         uint32_t tid;
    645644        int rc;
    646645
     
    659658            false);
    660659        if (t) {
    661                 tid = t->tid;
    662660                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
    665667                free(kernel_uarg);
    666         }
    667668
    668669        return (unative_t) ENOMEM;
     
    681682/** Syscall for getting TID.
    682683 *
    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 */
     689unative_t sys_thread_get_id(thread_id_t *uspace_thread_id)
    686690{
    687691        /*
     
    689693         * remains constant for the lifespan of the thread.
    690694         */
    691         return THREAD->tid;
     695        return (unative_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
     696            sizeof(THREAD->tid));
    692697}
    693698
  • kernel/generic/src/syscall/syscall.c

    r6adbe3c2 r201abde  
    101101                rc = syscall_table[id](a1, a2, a3, a4);
    102102        else {
    103                 klog_printf("TASK %lld: Unknown syscall id %d",TASK->taskid,id);
     103                klog_printf("TASK %llu: Unknown syscall id %d",TASK->taskid,id);
    104104                task_kill(TASK->taskid);
    105105                thread_exit();
Note: See TracChangeset for help on using the changeset viewer.