Changeset b7fd2a0 in mainline for kernel/generic/src/proc
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- kernel/generic/src/proc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/program.c
r36f0738 rb7fd2a0 69 69 * 70 70 */ 71 int program_create(as_t *as, uintptr_t entry_addr, char *name, program_t *prg)71 errno_t program_create(as_t *as, uintptr_t entry_addr, char *name, program_t *prg) 72 72 { 73 73 prg->loader_status = EE_OK; … … 137 137 * 138 138 */ 139 int program_create_from_image(void *image_addr, char *name, program_t *prg)139 errno_t program_create_from_image(void *image_addr, char *name, program_t *prg) 140 140 { 141 141 as_t *as = as_create(0); … … 174 174 * 175 175 */ 176 int program_create_loader(program_t *prg, char *name)176 errno_t program_create_loader(program_t *prg, char *name) 177 177 { 178 178 as_t *as = as_create(0); … … 225 225 * 226 226 */ 227 sys arg_t sys_program_spawn_loader(char *uspace_name, size_t name_len)227 sys_errno_t sys_program_spawn_loader(char *uspace_name, size_t name_len) 228 228 { 229 229 /* Cap length of name and copy it from userspace. */ … … 232 232 233 233 char namebuf[TASK_NAME_BUFLEN]; 234 int rc = copy_from_uspace(namebuf, uspace_name, name_len);234 errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len); 235 235 if (rc != 0) 236 return (sys arg_t) rc;236 return (sys_errno_t) rc; 237 237 238 238 namebuf[name_len] = 0; -
kernel/generic/src/proc/task.c
r36f0738 rb7fd2a0 83 83 /* Forward declarations. */ 84 84 static void task_kill_internal(task_t *); 85 static int tsk_constructor(void *, unsigned int);85 static errno_t tsk_constructor(void *, unsigned int); 86 86 static size_t tsk_destructor(void *obj); 87 87 … … 158 158 } 159 159 160 int tsk_constructor(void *obj, unsigned int kmflags)160 errno_t tsk_constructor(void *obj, unsigned int kmflags) 161 161 { 162 162 task_t *task = (task_t *) obj; 163 163 164 int rc = caps_task_alloc(task);164 errno_t rc = caps_task_alloc(task); 165 165 if (rc != EOK) 166 166 return rc; … … 246 246 (container_check(ipc_phone_0->task->container, task->container))) { 247 247 cap_handle_t phone_handle; 248 int rc = phone_alloc(task, &phone_handle);248 errno_t rc = phone_alloc(task, &phone_handle); 249 249 if (rc != EOK) { 250 250 task->as = NULL; … … 345 345 * 346 346 */ 347 sys arg_t sys_task_get_id(sysarg64_t *uspace_taskid)347 sys_errno_t sys_task_get_id(sysarg64_t *uspace_taskid) 348 348 { 349 349 /* … … 351 351 * the lifespan of the task. 352 352 */ 353 return (sys arg_t) copy_to_uspace(uspace_taskid, &TASK->taskid,353 return (sys_errno_t) copy_to_uspace(uspace_taskid, &TASK->taskid, 354 354 sizeof(TASK->taskid)); 355 355 } … … 385 385 * 386 386 */ 387 sys arg_t sys_task_set_name(const char *uspace_name, size_t name_len)387 sys_errno_t sys_task_set_name(const char *uspace_name, size_t name_len) 388 388 { 389 389 char namebuf[TASK_NAME_BUFLEN]; … … 393 393 name_len = TASK_NAME_BUFLEN - 1; 394 394 395 int rc = copy_from_uspace(namebuf, uspace_name, name_len);395 errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len); 396 396 if (rc != 0) 397 return (sys arg_t) rc;397 return (sys_errno_t) rc; 398 398 399 399 namebuf[name_len] = '\0'; … … 426 426 * 427 427 */ 428 sys arg_t sys_task_kill(task_id_t *uspace_taskid)428 sys_errno_t sys_task_kill(task_id_t *uspace_taskid) 429 429 { 430 430 task_id_t taskid; 431 int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid));431 errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid)); 432 432 if (rc != 0) 433 return (sys arg_t) rc;434 435 return (sys arg_t) task_kill(taskid);433 return (sys_errno_t) rc; 434 435 return (sys_errno_t) task_kill(taskid); 436 436 } 437 437 … … 539 539 * 540 540 */ 541 int task_kill(task_id_t id)541 errno_t task_kill(task_id_t id) 542 542 { 543 543 if (id == 1) … … 596 596 * 597 597 */ 598 sys arg_t sys_task_exit(sysarg_t notify)598 sys_errno_t sys_task_exit(sysarg_t notify) 599 599 { 600 600 task_kill_self(notify); -
kernel/generic/src/proc/thread.c
r36f0738 rb7fd2a0 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; … … 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) … … 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);939 errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len); 940 940 if (rc != 0) 941 return (sys arg_t) rc;941 return (sys_errno_t) rc; 942 942 943 943 namebuf[name_len] = 0; … … 953 953 if (rc != 0) { 954 954 free(kernel_uarg); 955 return (sys arg_t) rc;955 return (sys_errno_t) rc; 956 956 } 957 957 … … 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(); … … 1018 1018 * 1019 1019 */ 1020 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) 1021 1021 { 1022 1022 /* … … 1025 1025 * 1026 1026 */ 1027 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, 1028 1028 sizeof(THREAD->tid)); 1029 1029 } 1030 1030 1031 1031 /** Syscall wrapper for sleeping. */ 1032 sys arg_t sys_thread_usleep(uint32_t usec)1032 sys_errno_t sys_thread_usleep(uint32_t usec) 1033 1033 { 1034 1034 thread_usleep(usec); … … 1036 1036 } 1037 1037 1038 sys arg_t sys_thread_udelay(uint32_t usec)1038 sys_errno_t sys_thread_udelay(uint32_t usec) 1039 1039 { 1040 1040 delay(usec);
Note:
See TracChangeset
for help on using the changeset viewer.