Rev 1248 | Rev 1358 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1248 | Rev 1288 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | #include <ipc/ipc.h> |
46 | #include <ipc/ipc.h> |
47 | #include <security/cap.h> |
47 | #include <security/cap.h> |
48 | #include <memstr.h> |
48 | #include <memstr.h> |
49 | #include <print.h> |
49 | #include <print.h> |
50 | #include <elf.h> |
50 | #include <elf.h> |
51 | - | ||
- | 51 | #include <syscall/copy.h> |
|
52 | 52 | ||
53 | #ifndef LOADED_PROG_STACK_PAGES_NO |
53 | #ifndef LOADED_PROG_STACK_PAGES_NO |
54 | #define LOADED_PROG_STACK_PAGES_NO 1 |
54 | #define LOADED_PROG_STACK_PAGES_NO 1 |
55 | #endif |
55 | #endif |
56 | 56 | ||
Line 168... | Line 168... | ||
168 | 168 | ||
169 | /** Syscall for reading task ID from userspace. |
169 | /** Syscall for reading task ID from userspace. |
170 | * |
170 | * |
171 | * @param uspace_task_id Userspace address of 8-byte buffer where to store current task ID. |
171 | * @param uspace_task_id Userspace address of 8-byte buffer where to store current task ID. |
172 | * |
172 | * |
173 | * @return Always returns 0. |
173 | * @return 0 on success or an error code from @ref errno.h. |
174 | */ |
174 | */ |
175 | __native sys_task_get_id(task_id_t *uspace_task_id) |
175 | __native sys_task_get_id(task_id_t *uspace_task_id) |
176 | { |
176 | { |
177 | /* |
177 | /* |
178 | * No need to acquire lock on TASK because taskid |
178 | * No need to acquire lock on TASK because taskid |
179 | * remains constant for the lifespan of the task. |
179 | * remains constant for the lifespan of the task. |
180 | */ |
180 | */ |
181 | copy_to_uspace(uspace_task_id, &TASK->taskid, sizeof(TASK->taskid)); |
181 | return (__native) copy_to_uspace(uspace_task_id, &TASK->taskid, sizeof(TASK->taskid)); |
182 | - | ||
183 | return 0; |
- | |
184 | } |
182 | } |
185 | 183 | ||
186 | /** Find task structure corresponding to task ID. |
184 | /** Find task structure corresponding to task ID. |
187 | * |
185 | * |
188 | * The tasks_lock must be already held by the caller of this function |
186 | * The tasks_lock must be already held by the caller of this function |