Ignore:
File:
1 edited

Legend:

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

    r82d515e9 ra53ed3a  
    153153 *
    154154 */
    155 static int thr_constructor(void *obj, unsigned int kmflags)
     155static errno_t 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 -1;
     173                return ENOMEM;
    174174#endif /* CONFIG_FPU_LAZY */
    175175#endif /* CONFIG_FPU */
     
    201201                        slab_free(fpu_context_cache, thread->saved_fpu_context);
    202202#endif
    203                 return -1;
     203                return ENOMEM;
    204204        }
    205205       
     
    210210#endif
    211211       
    212         return 0;
     212        return EOK;
    213213}
    214214
     
    548548 *
    549549 * Threads that are blocked waiting for a synchronization primitive
    550  * are woken up with a return code of ESYNCH_INTERRUPTED if the
     550 * are woken up with a return code of EINTR if the
    551551 * blocking call was interruptable. See waitq_sleep_timeout().
    552552 *
     
    639639 *
    640640 */
    641 int thread_join_timeout(thread_t *thread, uint32_t usec, unsigned int flags)
     641errno_t 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);
     655        return waitq_sleep_timeout(&thread->join_wq, usec, flags, NULL);
    656656}
    657657
     
    700700        waitq_initialize(&wq);
    701701       
    702         (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING);
     702        (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING, NULL);
    703703}
    704704
     
    930930 *
    931931 */
    932 sysarg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
     932sys_errno_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         int rc = copy_from_uspace(namebuf, uspace_name, name_len);
    940         if (rc != 0)
    941                 return (sysarg_t) rc;
     939        errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len);
     940        if (rc != EOK)
     941                return (sys_errno_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 != 0) {
     953        if (rc != EOK) {
    954954                free(kernel_uarg);
    955                 return (sysarg_t) rc;
     955                return (sys_errno_t) rc;
    956956        }
    957957       
     
    962962                        rc = copy_to_uspace(uspace_thread_id, &thread->tid,
    963963                            sizeof(thread->tid));
    964                         if (rc != 0) {
     964                        if (rc != EOK) {
    965965                                /*
    966966                                 * We have encountered a failure, but the thread
     
    977977                                free(kernel_uarg);
    978978                               
    979                                 return (sysarg_t) rc;
     979                                return (sys_errno_t) rc;
    980980                         }
    981981                }
     
    999999                free(kernel_uarg);
    10001000       
    1001         return (sysarg_t) ENOMEM;
     1001        return (sys_errno_t) ENOMEM;
    10021002}
    10031003
     
    10051005 *
    10061006 */
    1007 sysarg_t sys_thread_exit(int uspace_status)
     1007sys_errno_t sys_thread_exit(int uspace_status)
    10081008{
    10091009        thread_exit();
    1010        
    1011         /* Unreachable */
    1012         return 0;
    10131010}
    10141011
     
    10211018 *
    10221019 */
    1023 sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id)
     1020sys_errno_t sys_thread_get_id(thread_id_t *uspace_thread_id)
    10241021{
    10251022        /*
     
    10281025         *
    10291026         */
    1030         return (sysarg_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
     1027        return (sys_errno_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,
    10311028            sizeof(THREAD->tid));
    10321029}
    10331030
    10341031/** Syscall wrapper for sleeping. */
    1035 sysarg_t sys_thread_usleep(uint32_t usec)
     1032sys_errno_t sys_thread_usleep(uint32_t usec)
    10361033{
    10371034        thread_usleep(usec);
     
    10391036}
    10401037
    1041 sysarg_t sys_thread_udelay(uint32_t usec)
     1038sys_errno_t sys_thread_udelay(uint32_t usec)
    10421039{
    10431040        delay(usec);
Note: See TracChangeset for help on using the changeset viewer.