Rev 195 | Rev 213 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 195 | Rev 210 | ||
---|---|---|---|
Line 183... | Line 183... | ||
183 | pri = cpu_priority_high(); |
183 | pri = cpu_priority_high(); |
184 | spinlock_lock(&tidlock); |
184 | spinlock_lock(&tidlock); |
185 | t->tid = ++last_tid; |
185 | t->tid = ++last_tid; |
186 | spinlock_unlock(&tidlock); |
186 | spinlock_unlock(&tidlock); |
187 | cpu_priority_restore(pri); |
187 | cpu_priority_restore(pri); |
188 | 188 | ||
189 | memsetb(frame_ks, THREAD_STACK_SIZE, 0); |
189 | memsetb(frame_ks, THREAD_STACK_SIZE, 0); |
190 | link_initialize(&t->rq_link); |
190 | link_initialize(&t->rq_link); |
191 | link_initialize(&t->wq_link); |
191 | link_initialize(&t->wq_link); |
192 | link_initialize(&t->th_link); |
192 | link_initialize(&t->th_link); |
193 | link_initialize(&t->threads_link); |
193 | link_initialize(&t->threads_link); |
194 | t->kstack = (__u8 *) frame_ks; |
194 | t->kstack = (__u8 *) frame_ks; |
195 | t->ustack = (__u8 *) frame_us; |
195 | t->ustack = (__u8 *) frame_us; |
196 | 196 | ||
197 | - | ||
198 | context_save(&t->saved_context); |
197 | context_save(&t->saved_context); |
199 | context_set(&t->saved_context, FADDR(cushion), t->kstack, THREAD_STACK_SIZE); |
198 | context_set(&t->saved_context, FADDR(cushion), t->kstack, THREAD_STACK_SIZE); |
200 | 199 | ||
201 | the_initialize((the_t *) t->kstack); |
200 | the_initialize((the_t *) t->kstack); |
202 | 201 |