Changeset a9b6bec in mainline for kernel/generic/src/proc/task.c
- Timestamp:
- 2010-12-14T20:19:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11658b64
- Parents:
- 37f7cfe (diff), 228e490 (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
r37f7cfe ra9b6bec 290 290 } 291 291 292 /** Syscall for reading task ID from userspace. 293 * 294 * @param uspace_task_id Userspace address of 8-byte buffer 295 * 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. 296 298 * 297 299 * @return Zero on success or an error code from @ref errno.h. 298 300 * 299 301 */ 300 unative_t sys_task_get_id(task_id_t *uspace_task_id)302 sysarg_t sys_task_get_id(sysarg64_t *uspace_taskid) 301 303 { 302 304 /* … … 304 306 * the lifespan of the task. 305 307 */ 306 return ( unative_t) copy_to_uspace(uspace_task_id, &TASK->taskid,308 return (sysarg_t) copy_to_uspace(uspace_taskid, &TASK->taskid, 307 309 sizeof(TASK->taskid)); 308 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__ */ 309 331 310 332 /** Syscall for setting the task name. … … 318 340 * 319 341 */ 320 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) 321 343 { 322 344 int rc; … … 330 352 rc = copy_from_uspace(namebuf, uspace_name, name_len); 331 353 if (rc != 0) 332 return ( unative_t) rc;354 return (sysarg_t) rc; 333 355 334 356 namebuf[name_len] = '\0';
Note:
See TracChangeset
for help on using the changeset viewer.