Changeset 87b4baa in mainline for kernel/generic/src/proc/task.c
- Timestamp:
- 2010-12-17T20:16:46Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 424558a
- Parents:
- 463e734 (diff), bbc74af7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
r463e734 r87b4baa 151 151 atomic_set(&task->refcount, 0); 152 152 atomic_set(&task->lifecount, 0); 153 atomic_set(&task->active_calls, 0);154 153 155 154 irq_spinlock_initialize(&task->lock, "task_t_lock"); … … 291 290 } 292 291 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. 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. 297 298 * 298 299 * @return Zero on success or an error code from @ref errno.h. 299 300 * 300 301 */ 301 unative_t sys_task_get_id(task_id_t *uspace_task_id)302 sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid) 302 303 { 303 304 /* … … 305 306 * the lifespan of the task. 306 307 */ 307 return ( unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid,308 return (sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid, 308 309 sizeof(TASK->taskid)); 309 310 } 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 for 325 * the lifespan of the task. 326 */ 327 return TASK->taskid; 328 } 329 330 #endif /* __64_BITS__ */ 310 331 311 332 /** Syscall for setting the task name. … … 319 340 * 320 341 */ 321 unative_t sys_task_set_name(const char *uspace_name, size_t name_len)342 sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len) 322 343 { 323 344 int rc; … … 331 352 rc = copy_from_uspace(namebuf, uspace_name, name_len); 332 353 if (rc != 0) 333 return ( unative_t) rc;354 return (sysarg_t) rc; 334 355 335 356 namebuf[name_len] = '\0'; … … 478 499 #ifdef __32_BITS__ 479 500 if (*additional) 480 printf("%-8" PRIu64 " %9" PRIua " %7" PRIua, task->taskid,481 atomic_get(&task->refcount) , atomic_get(&task->active_calls));501 printf("%-8" PRIu64 " %9" PRIua, task->taskid, 502 atomic_get(&task->refcount)); 482 503 else 483 504 printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %10p %10p" … … 490 511 if (*additional) 491 512 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c " 492 "%9" PRIua " %7" PRIua, 493 task->taskid, ucycles, usuffix, kcycles, ksuffix, 494 atomic_get(&task->refcount), atomic_get(&task->active_calls)); 513 "%9" PRIua, task->taskid, ucycles, usuffix, kcycles, 514 ksuffix, atomic_get(&task->refcount)); 495 515 else 496 516 printf("%-8" PRIu64 " %-14s %-5" PRIu32 " %18p %18p\n",
Note:
See TracChangeset
for help on using the changeset viewer.