Subversion Repositories HelenOS-historic

Rev

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

Rev 1086 Rev 1115
Line 115... Line 115...
115
    thread_t *t;
115
    thread_t *t;
116
    task_t *task;
116
    task_t *task;
117
    uspace_arg_t *kernel_uarg;
117
    uspace_arg_t *kernel_uarg;
118
 
118
 
119
    as = as_create(0);
119
    as = as_create(0);
-
 
120
    ASSERT(as);
120
 
121
 
121
    rc = elf_load((elf_header_t *) program_addr, as);
122
    rc = elf_load((elf_header_t *) program_addr, as);
122
    if (rc != EE_OK) {
123
    if (rc != EE_OK) {
123
        as_free(as);
124
        as_free(as);
124
        return NULL;
125
        return NULL;
Line 130... Line 131...
130
    kernel_uarg->uspace_thread_function = NULL;
131
    kernel_uarg->uspace_thread_function = NULL;
131
    kernel_uarg->uspace_thread_arg = NULL;
132
    kernel_uarg->uspace_thread_arg = NULL;
132
    kernel_uarg->uspace_uarg = NULL;
133
    kernel_uarg->uspace_uarg = NULL;
133
   
134
   
134
    task = task_create(as, name);
135
    task = task_create(as, name);
135
    t = thread_create(uinit, kernel_uarg, task, 0, "uinit");
136
    ASSERT(task);
136
   
137
 
137
    /*
138
    /*
138
     * Create the data as_area.
139
     * Create the data as_area.
139
     */
140
     */
140
    a = as_area_create(as, AS_AREA_READ | AS_AREA_WRITE, PAGE_SIZE, USTACK_ADDRESS);
141
    a = as_area_create(as, AS_AREA_READ | AS_AREA_WRITE, PAGE_SIZE, USTACK_ADDRESS);
141
   
-
 
142
    thread_ready(t);
-
 
143
 
142
 
-
 
143
    t = thread_create(uinit, kernel_uarg, task, 0, "uinit");
-
 
144
    ASSERT(t);
-
 
145
    thread_ready(t);
-
 
146
   
144
    return task;
147
    return task;
145
}
148
}
146
 
149
 
147
/** Print task list */
150
/** Print task list */
148
void task_print_list(void)
151
void task_print_list(void)
Line 157... Line 160...
157
    spinlock_lock(&tasks_lock);
160
    spinlock_lock(&tasks_lock);
158
 
161
 
159
    for (cur=tasks_head.next; cur!=&tasks_head; cur=cur->next) {
162
    for (cur=tasks_head.next; cur!=&tasks_head; cur=cur->next) {
160
        t = list_get_instance(cur, task_t, tasks_link);
163
        t = list_get_instance(cur, task_t, tasks_link);
161
        spinlock_lock(&t->lock);
164
        spinlock_lock(&t->lock);
162
        printf("%s: address=%P, taskid=%Q\n\tas=%P, ActiveCalls: %d",
165
        printf("%s: address=%P, taskid=%Q, as=%P, ActiveCalls: %d",
163
            t->name, t, t->taskid, t->as, atomic_get(&t->active_calls));
166
            t->name, t, t->taskid, t->as, atomic_get(&t->active_calls));
164
        for (i=0; i < IPC_MAX_PHONES; i++) {
167
        for (i=0; i < IPC_MAX_PHONES; i++) {
165
            if (t->phones[i].callee)
168
            if (t->phones[i].callee)
166
                printf(" Ph(%d): %P ", i,t->phones[i].callee);
169
                printf(" Ph(%d): %P ", i,t->phones[i].callee);
167
        }
170
        }