Changeset faf38b2 in mainline for kernel/generic/src/ps/ps.c


Ignore:
Timestamp:
2010-04-09T09:41:39Z (14 years ago)
Author:
Stanislav Kozina <stanislav.kozina@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
638927a
Parents:
a325832
Message:

Removed thread selection from kernel.
Now all threads are copied to uspace and then selected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ps/ps.c

    ra325832 rfaf38b2  
    4848static size_t count;
    4949static size_t max_count;
    50 static task_t *selected_task;
    5150
    5251#define WRITE_TASK_ID(dst, i, src) copy_to_uspace(dst + i, src, sizeof(task_id_t))
     
    163162        spinlock_lock(&t->lock);
    164163
    165         if (t->task != selected_task) {
    166                 spinlock_unlock(&t->lock);
    167                 return true;
    168         }
    169 
    170164        ++count;
    171165        if (count > max_count) {
     
    175169       
    176170        result.tid = t->tid;
     171        ASSERT(t->task);
     172        result.taskid = t->task->taskid;
    177173        result.state = t->state;
    178174        result.priority = t->priority;
     
    191187}
    192188
    193 int sys_ps_get_threads(task_id_t *uspace_id, thread_info_t *uspace_infos, size_t size)
     189int sys_ps_get_threads(thread_info_t *uspace_infos, size_t size)
    194190{
    195191        ipl_t ipl;
    196192        ipl = interrupts_disable();
    197193
    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);
    208195        spinlock_lock(&threads_lock);
    209196
Note: See TracChangeset for help on using the changeset viewer.