Changeset 0f250f9 in mainline for generic/src/proc/thread.c


Ignore:
Timestamp:
2006-03-17T18:07:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
69f293e
Parents:
6c6a19e6
Message:

Improved uspace threads.
ia64 needs fixing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/thread.c

    r6c6a19e6 r0f250f9  
    3030#include <proc/thread.h>
    3131#include <proc/task.h>
     32#include <proc/uarg.h>
    3233#include <mm/frame.h>
    3334#include <mm/page.h>
     
    430431 *
    431432 */
    432 __native sys_thread_create(__address function, void *arg, void *stack, char *name)
     433__native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name)
    433434{
    434435        thread_t *t;
    435436        char namebuf[THREAD_NAME_BUFLEN];
    436         uspace_arg_t *uarg;
     437        uspace_arg_t *kernel_uarg;              /* TODO: store kernel_uarg in thread_t */
    437438        __u32 tid;
    438439
    439         copy_from_uspace(namebuf, name, THREAD_NAME_BUFLEN);
    440         uarg = (uspace_arg_t *) malloc(sizeof(uarg), 0);
    441        
    442         uarg->uspace_entry = function;
    443         uarg->uspace_stack = (__address) stack;
    444 
    445         if ((t = thread_create(uinit, uarg, TASK, 0, namebuf))) {
     440        copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN);
     441
     442        kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
     443        copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t));
     444
     445        if ((t = thread_create(uinit, kernel_uarg, TASK, 0, namebuf))) {
    446446                tid = t->tid;
    447447                thread_ready(t);
    448448                return (__native) tid;
    449449        } else {
    450                 free(namebuf);
     450                free(kernel_uarg);
    451451        }
    452452
     
    457457 *
    458458 */
    459 __native sys_thread_exit(int status)
     459__native sys_thread_exit(int uspace_status)
    460460{
    461461        thread_exit();
Note: See TracChangeset for help on using the changeset viewer.