Changes in kernel/generic/src/proc/thread.c [82d515e9:a53ed3a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
r82d515e9 ra53ed3a 153 153 * 154 154 */ 155 static int thr_constructor(void *obj, unsigned int kmflags)155 static errno_t thr_constructor(void *obj, unsigned int kmflags) 156 156 { 157 157 thread_t *thread = (thread_t *) obj; … … 171 171 thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags); 172 172 if (!thread->saved_fpu_context) 173 return -1;173 return ENOMEM; 174 174 #endif /* CONFIG_FPU_LAZY */ 175 175 #endif /* CONFIG_FPU */ … … 201 201 slab_free(fpu_context_cache, thread->saved_fpu_context); 202 202 #endif 203 return -1;203 return ENOMEM; 204 204 } 205 205 … … 210 210 #endif 211 211 212 return 0;212 return EOK; 213 213 } 214 214 … … 548 548 * 549 549 * Threads that are blocked waiting for a synchronization primitive 550 * are woken up with a return code of E SYNCH_INTERRUPTEDif the550 * are woken up with a return code of EINTR if the 551 551 * blocking call was interruptable. See waitq_sleep_timeout(). 552 552 * … … 639 639 * 640 640 */ 641 int thread_join_timeout(thread_t *thread, uint32_t usec, unsigned int flags)641 errno_t thread_join_timeout(thread_t *thread, uint32_t usec, unsigned int flags) 642 642 { 643 643 if (thread == THREAD) … … 653 653 irq_spinlock_unlock(&thread->lock, true); 654 654 655 return waitq_sleep_timeout(&thread->join_wq, usec, flags );655 return waitq_sleep_timeout(&thread->join_wq, usec, flags, NULL); 656 656 } 657 657 … … 700 700 waitq_initialize(&wq); 701 701 702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING );702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING, NULL); 703 703 } 704 704 … … 930 930 * 931 931 */ 932 sys arg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,932 sys_errno_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, 933 933 size_t name_len, thread_id_t *uspace_thread_id) 934 934 { … … 937 937 938 938 char namebuf[THREAD_NAME_BUFLEN]; 939 int rc = copy_from_uspace(namebuf, uspace_name, name_len);940 if (rc != 0)941 return (sys arg_t) rc;939 errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len); 940 if (rc != EOK) 941 return (sys_errno_t) rc; 942 942 943 943 namebuf[name_len] = 0; … … 951 951 952 952 rc = copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t)); 953 if (rc != 0) {953 if (rc != EOK) { 954 954 free(kernel_uarg); 955 return (sys arg_t) rc;955 return (sys_errno_t) rc; 956 956 } 957 957 … … 962 962 rc = copy_to_uspace(uspace_thread_id, &thread->tid, 963 963 sizeof(thread->tid)); 964 if (rc != 0) {964 if (rc != EOK) { 965 965 /* 966 966 * We have encountered a failure, but the thread … … 977 977 free(kernel_uarg); 978 978 979 return (sys arg_t) rc;979 return (sys_errno_t) rc; 980 980 } 981 981 } … … 999 999 free(kernel_uarg); 1000 1000 1001 return (sys arg_t) ENOMEM;1001 return (sys_errno_t) ENOMEM; 1002 1002 } 1003 1003 … … 1005 1005 * 1006 1006 */ 1007 sys arg_t sys_thread_exit(int uspace_status)1007 sys_errno_t sys_thread_exit(int uspace_status) 1008 1008 { 1009 1009 thread_exit(); 1010 1011 /* Unreachable */1012 return 0;1013 1010 } 1014 1011 … … 1021 1018 * 1022 1019 */ 1023 sys arg_t sys_thread_get_id(thread_id_t *uspace_thread_id)1020 sys_errno_t sys_thread_get_id(thread_id_t *uspace_thread_id) 1024 1021 { 1025 1022 /* … … 1028 1025 * 1029 1026 */ 1030 return (sys arg_t) copy_to_uspace(uspace_thread_id, &THREAD->tid,1027 return (sys_errno_t) copy_to_uspace(uspace_thread_id, &THREAD->tid, 1031 1028 sizeof(THREAD->tid)); 1032 1029 } 1033 1030 1034 1031 /** Syscall wrapper for sleeping. */ 1035 sys arg_t sys_thread_usleep(uint32_t usec)1032 sys_errno_t sys_thread_usleep(uint32_t usec) 1036 1033 { 1037 1034 thread_usleep(usec); … … 1039 1036 } 1040 1037 1041 sys arg_t sys_thread_udelay(uint32_t usec)1038 sys_errno_t sys_thread_udelay(uint32_t usec) 1042 1039 { 1043 1040 delay(usec);
Note:
See TracChangeset
for help on using the changeset viewer.