Subversion Repositories HelenOS-historic

Rev

Rev 1048 | Rev 1062 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1048 Rev 1060
Line 36... Line 36...
36
#include <arch.h>
36
#include <arch.h>
37
#include <panic.h>
37
#include <panic.h>
38
#include <adt/list.h>
38
#include <adt/list.h>
39
#include <ipc/ipc.h>
39
#include <ipc/ipc.h>
40
#include <memstr.h>
40
#include <memstr.h>
-
 
41
#include <print.h>
41
 
42
 
42
#include <elf.h>
43
#include <elf.h>
43
 
44
 
44
SPINLOCK_INITIALIZE(tasks_lock);
45
SPINLOCK_INITIALIZE(tasks_lock);
45
LIST_INITIALIZE(tasks_head);
46
LIST_INITIALIZE(tasks_head);
Line 129... Line 130...
129
   
130
   
130
    thread_ready(t);
131
    thread_ready(t);
131
 
132
 
132
    return task;
133
    return task;
133
}
134
}
-
 
135
 
-
 
136
/** Print task list */
-
 
137
void task_print_list(void)
-
 
138
{
-
 
139
    link_t *cur;
-
 
140
    task_t *t;
-
 
141
    ipl_t ipl;
-
 
142
    int i;
-
 
143
   
-
 
144
    /* Messing with thread structures, avoid deadlock */
-
 
145
    ipl = interrupts_disable();
-
 
146
    spinlock_lock(&tasks_lock);
-
 
147
 
-
 
148
    for (cur=tasks_head.next; cur!=&tasks_head; cur=cur->next) {
-
 
149
        t = list_get_instance(cur, task_t, tasks_link);
-
 
150
        spinlock_lock(&t->lock);
-
 
151
        printf("Task: %Q ActiveCalls: %d", t->taskid,
-
 
152
               atomic_get(&t->active_calls));
-
 
153
        for (i=0; i < IPC_MAX_PHONES; i++) {
-
 
154
            if (t->phones[i].callee)
-
 
155
                printf(" Ph(%d): %P ", i,t->phones[i].callee);
-
 
156
        }
-
 
157
        printf("\n");
-
 
158
        spinlock_unlock(&t->lock);
-
 
159
    }
-
 
160
 
-
 
161
    spinlock_unlock(&tasks_lock);
-
 
162
    interrupts_restore(ipl);
-
 
163
   
-
 
164
}