Changes in kernel/generic/src/proc/task.c [dd8d5a7:be06914] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
rdd8d5a7 rbe06914 151 151 atomic_set(&task->refcount, 0); 152 152 atomic_set(&task->lifecount, 0); 153 atomic_set(&task->active_calls, 0); 153 154 154 155 irq_spinlock_initialize(&task->lock, "task_t_lock"); … … 290 291 } 291 292 292 #ifdef __32_BITS__ 293 294 /** Syscall for reading task ID from userspace (32 bits) 295 * 296 * @param uspace_taskid Pointer to user-space buffer 297 * where to store current task ID. 293 /** Syscall for reading task ID from userspace. 294 * 295 * @param uspace_task_id Userspace address of 8-byte buffer 296 * where to store current task ID. 298 297 * 299 298 * @return Zero on success or an error code from @ref errno.h. 300 299 * 301 300 */ 302 sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid)301 unative_t sys_task_get_id(task_id_t *uspace_task_id) 303 302 { 304 303 /* … … 306 305 * the lifespan of the task. 307 306 */ 308 return ( sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid,307 return (unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid, 309 308 sizeof(TASK->taskid)); 310 309 } 311 312 #endif /* __32_BITS__ */313 314 #ifdef __64_BITS__315 316 /** Syscall for reading task ID from userspace (64 bits)317 *318 * @return Current task ID.319 *320 */321 sysarg_t sys_task_get_id(void)322 {323 /*324 * No need to acquire lock on TASK because taskid remains constant for325 * the lifespan of the task.326 */327 return TASK->taskid;328 }329 330 #endif /* __64_BITS__ */331 310 332 311 /** Syscall for setting the task name. … … 340 319 * 341 320 */ 342 sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len)321 unative_t sys_task_set_name(const char *uspace_name, size_t name_len) 343 322 { 344 323 int rc; … … 352 331 rc = copy_from_uspace(namebuf, uspace_name, name_len); 353 332 if (rc != 0) 354 return ( sysarg_t) rc;333 return (unative_t) rc; 355 334 356 335 namebuf[name_len] = '\0'; … … 499 478 #ifdef __32_BITS__ 500 479 if (*additional) 501 printf("%-8" PRIu64 " %9 " PRIua, task->taskid,502 atomic_get(&task->refcount) );480 printf("%-8" PRIu64 " %9lu %7lu", task->taskid, 481 atomic_get(&task->refcount), atomic_get(&task->active_calls)); 503 482 else 504 483 printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p" … … 510 489 #ifdef __64_BITS__ 511 490 if (*additional) 512 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c "513 "%9" PRIua, task->taskid, ucycles, usuffix, kcycles,514 ksuffix, atomic_get(&task->refcount));491 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c %9lu %7lu", 492 task->taskid, ucycles, usuffix, kcycles, ksuffix, 493 atomic_get(&task->refcount), atomic_get(&task->active_calls)); 515 494 else 516 495 printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n", … … 522 501 for (i = 0; i < IPC_MAX_PHONES; i++) { 523 502 if (task->phones[i].callee) 524 printf(" % zu:%p", i, task->phones[i].callee);503 printf(" %" PRIs ":%p", i, task->phones[i].callee); 525 504 } 526 505 printf("\n");
Note:
See TracChangeset
for help on using the changeset viewer.