Changes in kernel/generic/src/proc/task.c [b2e121a:82d515e9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
rb2e121a r82d515e9 56 56 #include <print.h> 57 57 #include <errno.h> 58 #include < halt.h>58 #include <func.h> 59 59 #include <str.h> 60 60 #include <syscall/copy.h> … … 83 83 /* Forward declarations. */ 84 84 static void task_kill_internal(task_t *); 85 static errno_t tsk_constructor(void *, unsigned int);85 static int tsk_constructor(void *, unsigned int); 86 86 static size_t tsk_destructor(void *obj); 87 87 … … 158 158 } 159 159 160 errno_t tsk_constructor(void *obj, unsigned int kmflags)160 int tsk_constructor(void *obj, unsigned int kmflags) 161 161 { 162 162 task_t *task = (task_t *) obj; 163 163 164 errno_t rc = caps_task_alloc(task);164 int rc = caps_task_alloc(task); 165 165 if (rc != EOK) 166 166 return rc; … … 185 185 #endif 186 186 187 return EOK;187 return 0; 188 188 } 189 189 … … 207 207 { 208 208 task_t *task = (task_t *) slab_alloc(task_cache, 0); 209 if (task == NULL) {210 return NULL;211 }212 213 209 task_create_arch(task); 214 210 … … 245 241 if ((ipc_phone_0) && 246 242 (container_check(ipc_phone_0->task->container, task->container))) { 247 cap_handle_t phone_handle; 248 errno_t rc = phone_alloc(task, &phone_handle); 249 if (rc != EOK) { 250 task->as = NULL; 251 task_destroy_arch(task); 252 slab_free(task_cache, task); 253 return NULL; 254 } 255 243 cap_handle_t phone_handle = phone_alloc(task); 256 244 kobject_t *phone_obj = kobject_get(task, phone_handle, 257 245 KOBJECT_TYPE_PHONE); … … 345 333 * 346 334 */ 347 sys _errno_t sys_task_get_id(sysarg64_t *uspace_taskid)335 sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid) 348 336 { 349 337 /* … … 351 339 * the lifespan of the task. 352 340 */ 353 return (sys _errno_t) copy_to_uspace(uspace_taskid, &TASK->taskid,341 return (sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid, 354 342 sizeof(TASK->taskid)); 355 343 } … … 385 373 * 386 374 */ 387 sys _errno_t sys_task_set_name(const char *uspace_name, size_t name_len)375 sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len) 388 376 { 389 377 char namebuf[TASK_NAME_BUFLEN]; … … 393 381 name_len = TASK_NAME_BUFLEN - 1; 394 382 395 errno_t rc = copy_from_uspace(namebuf, uspace_name, name_len);396 if (rc != EOK)397 return (sys _errno_t) rc;383 int rc = copy_from_uspace(namebuf, uspace_name, name_len); 384 if (rc != 0) 385 return (sysarg_t) rc; 398 386 399 387 namebuf[name_len] = '\0'; … … 426 414 * 427 415 */ 428 sys _errno_t sys_task_kill(task_id_t *uspace_taskid)416 sysarg_t sys_task_kill(task_id_t *uspace_taskid) 429 417 { 430 418 task_id_t taskid; 431 errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid));432 if (rc != EOK)433 return (sys _errno_t) rc;434 435 return (sys _errno_t) task_kill(taskid);419 int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid)); 420 if (rc != 0) 421 return (sysarg_t) rc; 422 423 return (sysarg_t) task_kill(taskid); 436 424 } 437 425 … … 539 527 * 540 528 */ 541 errno_t task_kill(task_id_t id)529 int task_kill(task_id_t id) 542 530 { 543 531 if (id == 1) … … 596 584 * 597 585 */ 598 sys _errno_t sys_task_exit(sysarg_t notify)586 sysarg_t sys_task_exit(sysarg_t notify) 599 587 { 600 588 task_kill_self(notify);
Note:
See TracChangeset
for help on using the changeset viewer.