Changeset dd8d5a7 in mainline
- Timestamp:
- 2010-12-14T15:44:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 228e490
- Parents:
- 6b10dab
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/proc/task.h
r6b10dab rdd8d5a7 145 145 #endif 146 146 147 extern sysarg_t sys_task_get_id(task_id_t *); 147 #ifdef __32_BITS__ 148 extern sysarg_t sys_task_get_id(sysarg64_t *); 149 #endif 150 151 #ifdef __64_BITS__ 152 extern sysarg_t sys_task_get_id(void); 153 #endif 154 148 155 extern sysarg_t sys_task_set_name(const char *, size_t); 149 156 -
kernel/generic/src/ipc/kbox.c
r6b10dab rdd8d5a7 192 192 } 193 193 194 195 194 /** Connect phone to a task kernel-box specified by id. 196 195 * -
kernel/generic/src/proc/task.c
r6b10dab rdd8d5a7 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 sysarg_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 (sysarg_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. -
uspace/lib/c/generic/task.c
r6b10dab rdd8d5a7 47 47 task_id_t task_get_id(void) 48 48 { 49 #ifdef __32_BITS__ 49 50 task_id_t task_id; 50 51 (void) __SYSCALL1(SYS_TASK_GET_ID, (sysarg_t) &task_id); 51 52 52 53 return task_id; 54 #endif /* __32_BITS__ */ 55 56 #ifdef __64_BITS__ 57 return (task_id_t) __SYSCALL0(SYS_TASK_GET_ID); 58 #endif /* __64_BITS__ */ 53 59 } 54 60
Note:
See TracChangeset
for help on using the changeset viewer.