Changeset faf38b2 in mainline for kernel/generic/src/ps/ps.c
- Timestamp:
- 2010-04-09T09:41:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 638927a
- Parents:
- a325832
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ps/ps.c
ra325832 rfaf38b2 48 48 static size_t count; 49 49 static size_t max_count; 50 static task_t *selected_task;51 50 52 51 #define WRITE_TASK_ID(dst, i, src) copy_to_uspace(dst + i, src, sizeof(task_id_t)) … … 163 162 spinlock_lock(&t->lock); 164 163 165 if (t->task != selected_task) {166 spinlock_unlock(&t->lock);167 return true;168 }169 170 164 ++count; 171 165 if (count > max_count) { … … 175 169 176 170 result.tid = t->tid; 171 ASSERT(t->task); 172 result.taskid = t->task->taskid; 177 173 result.state = t->state; 178 174 result.priority = t->priority; … … 191 187 } 192 188 193 int sys_ps_get_threads(t ask_id_t *uspace_id, thread_info_t *uspace_infos, size_t size)189 int sys_ps_get_threads(thread_info_t *uspace_infos, size_t size) 194 190 { 195 191 ipl_t ipl; 196 192 ipl = interrupts_disable(); 197 193 198 task_id_t id; 199 copy_from_uspace(&id, uspace_id, sizeof(task_id_t)); 200 spinlock_lock(&tasks_lock); 201 selected_task = task_find_by_id(id); 202 spinlock_unlock(&tasks_lock); 203 204 if (!selected_task) { 205 return 0; 206 } 207 194 printf("LIst threads, size: %llu\n", size); 208 195 spinlock_lock(&threads_lock); 209 196
Note:
See TracChangeset
for help on using the changeset viewer.