Changeset ba9a150 in mainline
- Timestamp:
- 2018-11-09T22:03:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- abf6c01
- Parents:
- 4f3aa76
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-08 17:08:07)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 22:03:24)
- Location:
- kernel/generic/src/proc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
r4f3aa76 rba9a150 134 134 void scheduler_fpu_lazy_request(void) 135 135 { 136 restart:137 136 fpu_enable(); 138 137 irq_spinlock_lock(&CPU->lock, false); … … 153 152 fpu_context_restore(THREAD->saved_fpu_context); 154 153 } else { 155 /* Allocate FPU context */156 if (!THREAD->saved_fpu_context) {157 /* Might sleep */158 irq_spinlock_unlock(&THREAD->lock, false);159 irq_spinlock_unlock(&CPU->lock, false);160 THREAD->saved_fpu_context =161 (fpu_context_t *) slab_alloc(fpu_context_cache, 0);162 163 /* We may have switched CPUs during slab_alloc */164 goto restart;165 }166 154 fpu_init(); 167 155 THREAD->fpu_context_exists = true; -
kernel/generic/src/proc/thread.c
r4f3aa76 rba9a150 165 165 166 166 #ifdef CONFIG_FPU 167 #ifdef CONFIG_FPU_LAZY168 thread->saved_fpu_context = NULL;169 #else /* CONFIG_FPU_LAZY */170 167 thread->saved_fpu_context = slab_alloc(fpu_context_cache, kmflags); 171 168 if (!thread->saved_fpu_context) 172 169 return ENOMEM; 173 #endif /* CONFIG_FPU_LAZY */174 170 #endif /* CONFIG_FPU */ 175 171 … … 200 196 if (!stack_phys) { 201 197 #ifdef CONFIG_FPU 202 if (thread->saved_fpu_context)203 198 assert(thread->saved_fpu_context); 199 slab_free(fpu_context_cache, thread->saved_fpu_context); 204 200 #endif 205 201 return ENOMEM; … … 226 222 227 223 #ifdef CONFIG_FPU 228 if (thread->saved_fpu_context)229 224 assert(thread->saved_fpu_context); 225 slab_free(fpu_context_cache, thread->saved_fpu_context); 230 226 #endif 231 227
Note:
See TracChangeset
for help on using the changeset viewer.