Changes in kernel/generic/src/proc/thread.c [a53ed3a:82d515e9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
ra53ed3a r82d515e9 153 153 * 154 154 */ 155 static errno_t thr_constructor(void *obj, unsigned int kmflags)155 static int 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 ENOMEM;173 return -1; 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 ENOMEM;203 return -1; 204 204 } 205 205 … … 210 210 #endif 211 211 212 return EOK;212 return 0; 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 INTRif the550 * are woken up with a return code of ESYNCH_INTERRUPTED if the 551 551 * blocking call was interruptable. See waitq_sleep_timeout(). 552 552 * … … 639 639 * 640 640 */ 641 errno_t thread_join_timeout(thread_t *thread, uint32_t usec, unsigned int flags)641 int 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 , NULL);655 return waitq_sleep_timeout(&thread->join_wq, usec, flags); 656 656 } 657 657 … … 700 700 waitq_initialize(&wq); 701 701 702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING , NULL);702 (void) waitq_sleep_timeout(&wq, usec, SYNCH_FLAGS_NON_BLOCKING); 703 703 } 704 704 … … 930 930 * 931 931 */ 932 sys _errno_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,932 sysarg_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 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; 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 != EOK) {953 if (rc != 0) { 954 954 free(kernel_uarg); 955 return (sys _errno_t) rc;955 return (sysarg_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 != EOK) {964 if (rc != 0) { 965 965 /* 966 966 * We have encountered a failure, but the thread … … 977 977 free(kernel_uarg); 978 978 979 return (sys _errno_t) rc;979 return (sysarg_t) rc; 980 980 } 981 981 } … … 999 999 free(kernel_uarg); 1000 1000 1001 return (sys _errno_t) ENOMEM;1001 return (sysarg_t) ENOMEM; 1002 1002 } 1003 1003 … … 1005 1005 * 1006 1006 */ 1007 sys _errno_t sys_thread_exit(int uspace_status)1007 sysarg_t sys_thread_exit(int uspace_status) 1008 1008 { 1009 1009 thread_exit(); 1010 1011 /* Unreachable */ 1012 return 0; 1010 1013 } 1011 1014 … … 1018 1021 * 1019 1022 */ 1020 sys _errno_t sys_thread_get_id(thread_id_t *uspace_thread_id)1023 sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id) 1021 1024 { 1022 1025 /* … … 1025 1028 * 1026 1029 */ 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, 1028 1031 sizeof(THREAD->tid)); 1029 1032 } 1030 1033 1031 1034 /** Syscall wrapper for sleeping. */ 1032 sys _errno_t sys_thread_usleep(uint32_t usec)1035 sysarg_t sys_thread_usleep(uint32_t usec) 1033 1036 { 1034 1037 thread_usleep(usec); … … 1036 1039 } 1037 1040 1038 sys _errno_t sys_thread_udelay(uint32_t usec)1041 sysarg_t sys_thread_udelay(uint32_t usec) 1039 1042 { 1040 1043 delay(usec);
Note:
See TracChangeset
for help on using the changeset viewer.