Ignore:
File:
1 edited

Legend:

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

    ra53ed3a r82d515e9  
    153153 *
    154154 */
    155 static errno_t thr_constructor(void *obj, unsigned int kmflags)
     155static int thr_constructor(void *obj, unsigned int kmflags)
    156156{
    157157        thread_t *thread = (thread_t *) obj;
     
    171171        thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags);
    172172        if (!thread->saved_fpu_context)
    173                 return ENOMEM;
     173                return -1;
    174174#endif /* CONFIG_FPU_LAZY */
    175175#endif /* CONFIG_FPU */
     
    201201                        slab_free(fpu_context_cache, thread->saved_fpu_context);
    202202#endif
    203                 return ENOMEM;
     203                return -1;
    204204        }
    205205       
     
    210210#endif
    211211       
    212         return EOK;
     212        return 0;
    213213}
    214214
     
    548548 *
    549549 * Threads that are blocked waiting for a synchronization primitive
    550  * are woken up with a return code of EINTR if the
     550 * are woken up with a return code of ESYNCH_INTERRUPTED if the
    551551 * blocking call was interruptable. See waitq_sleep_timeout().
    552552 *
     
    639639 *
    640640 */
    641 errno_t thread_join_timeout(thread_t *thread, uint32_t usec, unsigned int flags)
     641int thread_join_timeout(thread_t *thread, uint32_t usec, unsigned int flags)
    642642{
    643643        if (thread == THREAD)
     
    653653        irq_spinlock_unlock(&thread->lock, true);
    654654       
    655         return waitq_sleep_timeout(&thread->join_wq, usec, flags, NULL);
     655        return waitq_sleep_timeout(&thread->join_wq, usec, flags);
    656656}
    657657
     
    700700        waitq_initialize(&wq);
    701701       
    702         (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING, NULL);
     702        (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING);
    703703}
    704704
     
    930930 *
    931931 */
    932 sys_errno_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
     932sysarg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
    933933    size_t name_len, thread_id_t *uspace_thread_id)
    934934{
     
    937937       
    938938        char namebuf[THREAD_NAME_BUFLEN];
    939         errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len);
    940         if (rc != EOK)
    941                 return (sys_errno_t) rc;
     939        int rc = copy_from_uspace(namebuf, uspace_name, name_len);
     940        if (rc != 0)
     941                return (sysarg_t) rc;
    942942       
    943943        namebuf[name_len] = 0;
     
    951951       
    952952        rc = copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t));
    953         if (rc != EOK) {
     953        if (rc != 0) {
    954954                free(kernel_uarg);
    955                 return (sys_errno_t) rc;
     955                return (sysarg_t) rc;
    956956        }
    957957       
     
    962962                        rc = copy_to_uspace(uspace_thread_id, &thread->tid,
    963963                            sizeof(thread->tid));
    964                         if (rc != EOK) {
     964                        if (rc != 0) {
    965965                                /*
    966966                                 * We have encountered a failure, but the thread
     
    977977                                free(kernel_uarg);
    978978                               
    979                                 return (sys_errno_t) rc;
     979                                return (sysarg_t) rc;
    980980                         }
    981981                }
     
    999999                free(kernel_uarg);
    10001000       
    1001         return (sys_errno_t) ENOMEM;
     1001        return (sysarg_t) ENOMEM;
    10021002}
    10031003
     
    10051005 *
    10061006 */
    1007 sys_errno_t sys_thread_exit(int uspace_status)
     1007sysarg_t sys_thread_exit(int uspace_status)
    10081008{
    10091009        thread_exit();
     1010       
     1011        /* Unreachable */
     1012        return 0;
    10101013}
    10111014
     
    10181021 *
    10191022 */
    1020 sys_errno_t sys_thread_get_id(thread_id_t *uspace_thread_id)
     1023sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id)
    10211024{
    10221025        /*
     
    10251028         *
    10261029         */
    1027         return (sys_errno_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
     1030        return (sysarg_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
    10281031            sizeof(THREAD->tid));
    10291032}
    10301033
    10311034/** Syscall wrapper for sleeping. */
    1032 sys_errno_t sys_thread_usleep(uint32_t usec)
     1035sysarg_t sys_thread_usleep(uint32_t usec)
    10331036{
    10341037        thread_usleep(usec);
     
    10361039}
    10371040
    1038 sys_errno_t sys_thread_udelay(uint32_t usec)
     1041sysarg_t sys_thread_udelay(uint32_t usec)
    10391042{
    10401043        delay(usec);
Note: See TracChangeset for help on using the changeset viewer.