Subversion Repositories HelenOS

Rev

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

Rev 1460 Rev 1468
Line 105... Line 105...
105
 
105
 
106
    mutex_initialize(&ta->futexes_lock);
106
    mutex_initialize(&ta->futexes_lock);
107
    btree_create(&ta->futexes);
107
    btree_create(&ta->futexes);
108
   
108
   
109
    ipl = interrupts_disable();
109
    ipl = interrupts_disable();
-
 
110
 
-
 
111
    /*
-
 
112
     * Increment address space reference count.
-
 
113
     * TODO: Reconsider the locking scheme.
-
 
114
     */
-
 
115
    mutex_lock(&as->lock);
-
 
116
    as->refcount++;
-
 
117
    mutex_unlock(&as->lock);
-
 
118
 
110
    spinlock_lock(&tasks_lock);
119
    spinlock_lock(&tasks_lock);
111
 
120
 
112
    ta->taskid = ++task_counter;
121
    ta->taskid = ++task_counter;
113
    btree_insert(&tasks_btree, (btree_key_t) ta->taskid, (void *) ta, NULL);
122
    btree_insert(&tasks_btree, (btree_key_t) ta->taskid, (void *) ta, NULL);
114
 
123
 
Line 137... Line 146...
137
    as = as_create(0);
146
    as = as_create(0);
138
    ASSERT(as);
147
    ASSERT(as);
139
 
148
 
140
    rc = elf_load((elf_header_t *) program_addr, as);
149
    rc = elf_load((elf_header_t *) program_addr, as);
141
    if (rc != EE_OK) {
150
    if (rc != EE_OK) {
142
        as_free(as);
151
        as_destroy(as);
143
        return NULL;
152
        return NULL;
144
    }
153
    }
145
   
154
   
146
    kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
155
    kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);
147
    kernel_uarg->uspace_entry = (void *) ((elf_header_t *) program_addr)->e_entry;
156
    kernel_uarg->uspace_entry = (void *) ((elf_header_t *) program_addr)->e_entry;