Rev 1760 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1760 | Rev 1766 | ||
|---|---|---|---|
| Line 122... | Line 122... | ||
| 122 | 122 | ||
| 123 | /** Initialization and allocation for thread_t structure */ |
123 | /** Initialization and allocation for thread_t structure */ |
| 124 | static int thr_constructor(void *obj, int kmflags) |
124 | static int thr_constructor(void *obj, int kmflags) |
| 125 | { |
125 | { |
| 126 | thread_t *t = (thread_t *)obj; |
126 | thread_t *t = (thread_t *)obj; |
| 127 | int status; |
- | |
| 128 | 127 | ||
| 129 | spinlock_initialize(&t->lock, "thread_t_lock"); |
128 | spinlock_initialize(&t->lock, "thread_t_lock"); |
| 130 | link_initialize(&t->rq_link); |
129 | link_initialize(&t->rq_link); |
| 131 | link_initialize(&t->wq_link); |
130 | link_initialize(&t->wq_link); |
| 132 | link_initialize(&t->th_link); |
131 | link_initialize(&t->th_link); |
| Line 139... | Line 138... | ||
| 139 | if (!t->saved_fpu_context) |
138 | if (!t->saved_fpu_context) |
| 140 | return -1; |
139 | return -1; |
| 141 | # endif |
140 | # endif |
| 142 | #endif |
141 | #endif |
| 143 | 142 | ||
| 144 | t->kstack = frame_alloc_rc(STACK_FRAMES, FRAME_KA | kmflags,&status); |
143 | t->kstack = frame_alloc(STACK_FRAMES, FRAME_KA | kmflags); |
| 145 | if (status) { |
144 | if (! t->kstack) { |
| 146 | #ifdef ARCH_HAS_FPU |
145 | #ifdef ARCH_HAS_FPU |
| 147 | if (t->saved_fpu_context) |
146 | if (t->saved_fpu_context) |
| 148 | slab_free(fpu_context_slab,t->saved_fpu_context); |
147 | slab_free(fpu_context_slab,t->saved_fpu_context); |
| 149 | #endif |
148 | #endif |
| 150 | return -1; |
149 | return -1; |