Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/uinit.c

    r3fcea34 r5a5269d  
    5656void uinit(void *arg)
    5757{
     58        /*
     59         * So far, we don't have a use for joining userspace threads so we
     60         * immediately detach each uinit thread. If joining of userspace threads
     61         * is required, some userspace API based on the kernel mechanism will
     62         * have to be implemented. Moreover, garbage collecting of threads that
     63         * didn't detach themselves and nobody else joined them will have to be
     64         * deployed for the event of forceful task termination.
     65         */
     66        thread_detach(THREAD);
     67
    5868#ifdef CONFIG_UDEBUG
    5969        udebug_stoppable_end();
    6070#endif
    6171
    62         uinit_arg_t *uarg = arg;
    63         sysarg_t pc = uarg->pc;
    64         sysarg_t sp = uarg->sp;
     72        uspace_arg_t *uarg = arg;
     73        uspace_arg_t local_uarg;
     74
     75        local_uarg.uspace_entry = uarg->uspace_entry;
     76        local_uarg.uspace_stack = uarg->uspace_stack;
     77        local_uarg.uspace_stack_size = uarg->uspace_stack_size;
     78        local_uarg.uspace_uarg = uarg->uspace_uarg;
     79        local_uarg.uspace_thread_function = USPACE_NULL;
     80        local_uarg.uspace_thread_arg = USPACE_NULL;
     81
    6582        free(uarg);
    6683
    67         userspace(pc, sp);
     84        userspace(&local_uarg);
    6885}
    6986
Note: See TracChangeset for help on using the changeset viewer.